Hi guys
I am trying to write something that take value from page 1 and looks for that value in a given range in page 2. I then want to make a loop so that it looks for that value in page two until the search returns no results.
This is my code:
a = Cells(counter, 3).Value
Do
Sheets("Sheet2").Select
Columns("C:C").Select
Selection.Find(What:=a, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Copy
Sheets("Sheet1").Select
Cells(counter, 4).PasteSpecial
Sheets("Sheet2").Select
***here is my problem. I want a loop that will do this command
Selection.FindNext(After:=ActiveCell).Activate
until there is no match.***
Next counter
Thanks for your help
I am trying to write something that take value from page 1 and looks for that value in a given range in page 2. I then want to make a loop so that it looks for that value in page two until the search returns no results.
This is my code:
a = Cells(counter, 3).Value
Do
Sheets("Sheet2").Select
Columns("C:C").Select
Selection.Find(What:=a, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Copy
Sheets("Sheet1").Select
Cells(counter, 4).PasteSpecial
Sheets("Sheet2").Select
***here is my problem. I want a loop that will do this command
Selection.FindNext(After:=ActiveCell).Activate
until there is no match.***
Next counter
Thanks for your help