in a if statement, how do i match a positive number with a negative one e.g. if 500 match with -500, cut and paste
one solution i thought of is changing one of the column by *-1 before i do anything but... Is there anyway i could rephase the below if statement to match a positive cell and a negative cell?
Dim sh1 As Worksheet, sh2 As Worksheet
Dim j As Long, i As Long, lastrow1 As Long, lastrow2 As Long
Set sh1 = Worksheets("WorksheetA")
Set sh2 = Worksheets("WorksheetB")
lastrow1 = sh1.Cells.SpecialCells(xlCellTypeLastCell).Row
lastrow2 = sh2.Cells.SpecialCells(xlCellTypeLastCell).Row
For i = 1 To lastrow1
For j = 1 To lastrow2
If sh1.Cells(i, "H").Value = sh2.Cells(j, "E").Value Then
sh2.Cells(j, "O").Value .Cut sh1.Cells(i, "L").Value
End If
Next j
Next i
End Sub