G
Guest
I am trying to search a column in my worksheet, and if that column has a
value that is not 1, then compare it to the cell value in the same row in
column N. If the two cell values are different then put the current
selection in column R. Does that make sense? Here is my code. any help is
appreciated!
Dim wks As Worksheet
Dim rngFound As Range
Set wks = Sheets("exam_am_trades")
Set rngToSearch = Range("p41700")
saddr = ActiveCell.Address
Set rngFound = rngToSearch.Find(what:="1", LookIn:=xlValues,
lookat:=xlWhole)
If rngFound = 1 Then
Set rngFound = rngToSearch.FindNext
Else
If rngFound <> saddr.Offset(0, -2) Then
saddr.Offset(0, 2) = saddr.Value
End If
End If
End Sub
value that is not 1, then compare it to the cell value in the same row in
column N. If the two cell values are different then put the current
selection in column R. Does that make sense? Here is my code. any help is
appreciated!
Dim wks As Worksheet
Dim rngFound As Range
Set wks = Sheets("exam_am_trades")
Set rngToSearch = Range("p41700")
saddr = ActiveCell.Address
Set rngFound = rngToSearch.Find(what:="1", LookIn:=xlValues,
lookat:=xlWhole)
If rngFound = 1 Then
Set rngFound = rngToSearch.FindNext
Else
If rngFound <> saddr.Offset(0, -2) Then
saddr.Offset(0, 2) = saddr.Value
End If
End If
End Sub