Hi there,
I'm trying to limit the search routine, below, to only find values from one column, D for example, at the moment it will find values from the whole sheet.
I've tried to limit the find a number of ways but haven't had any success.
Thanks in advance,
Nick
I'm trying to limit the search routine, below, to only find values from one column, D for example, at the moment it will find values from the whole sheet.
I've tried to limit the find a number of ways but haven't had any success.
Thanks in advance,
Nick
Code:
Sub FindCodesV2()
Dim rng1 As Range
Dim cel1 As Range
Dim counter As Integer
counter = 2
Set rng1 = Worksheets("Sheet1").Range("A2:A57")
For Each cel1 In rng1
cellValue = Cells.find(What:=cel1.Value, After:=cel1, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Worksheets("Sheet1").Cells(counter, 2).Value = ActiveCell
counter = counter + 1
Next cel1
End Sub