Hi I have found the following code to search for the word "SELL" in column F starting at row 6 and make the corresponding value in column G a negative value. As of now you can see my range is set to almost the max number of rows in excel 2010. I think this code could be optimized to be a little faster most likely by limiting the range to the last cell that contains data. Any ideas would be greatly appreciated.
Sub ChangeSign()
Dim MyRange As Range, c As Range
ScreenUpdating = False
Set MyRange = Range("F6:F1040000")
For Each c In MyRange
If Left(c.Value, 4) = "SELL" Then
c.Offset(, 1).Value = -c.Offset(, 1).Value
End If
Next c
End Sub
Bookmarks