Here's an image with Excel sample data. Columns used are A, B, F & G.
I am trying to find Part from a Column F into Column A to see if it is in Column A or not.
I know that I can use FIND
Function in VBA with (What:="Jane Doe"
) with a double quotes text. But, is it possible to use a relative reference such as ActiveCell.Offset(0,-1).Value
within the FIND
function in VBA?
Dim SearchRange As Range
Dim ECOCell As Range
Range("G2").Select
Set SearchRange = Range("A2", Range("A2").End(xlDown))
Set ECOCell = SearchRange.Find(What:=ActiveCell.Offset(0, -1).Value, MatchCase:=True, LookAt:=xlWhole)
Do While ActiveCell.Offset(0, -1).Value <> ""
If ECOCell Is Nothing Then
ActiveCell.Value = "No"
Else
ActiveCell.Value = "Yes"
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub