I'm looking to cycle through each row in a column on worksheet 1, to match two cells (a cell in column C from worksheet 1 with a cell in column E from worksheet 2).
If there is a match, I want to perform an action to an adjacent cell (I will work this bit out later) and then resume the loop until there are no more matches.
So far I have the following:
Sub Test3()
Dim x As String
Dim found As Boolean
' Select first line of data.
Worksheets("PLANNER_ONGOING_DISPLAY_SHEET").Activate
Range("C4").Select
' Set search variable value.
x = "test 73"
' Set Boolean variable "found" to false.
found = False
' Set Do loop to stop at empty cell.
Do Until IsEmpty(ActiveCell)
' Check active cell for search value.
If ActiveCell.Value = x Then
found = True
Exit Do
End If
' Step down 1 row from present location.
ActiveCell.Offset(1, 0).Select
Loop
' Check for found.
If found = True Then
MsgBox "Value found in cell " & ActiveCell.Address
Else
MsgBox "Value not found"
End If
End Sub