I would like the macro to loop through 1 to 100 using the value for i as the row value for the range.
Then the macro should search for all cells which match the value in "Ai" and delete the rows. Once this is done (and the find function errors) the value for i should increment by 1 and do it again. Note, there may be multiple entries for a value in "Ai"
Many thanks
For i = 2 To 100
Do
On Error GoTo A1
Cells.Find(What:=(Worksheets("Prices out put").Range(Cells(i, 1)).Value), After:=ActiveCell, LookIn:=xlValues _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Resize(Worksheets("Prices out put").Range(Cells(i, 2)).Value, 1).Select
Selection.Delete Shift:=xlUp
Loop
A1:
Resume B1:
B1:
Next
End Sub
Then the macro should search for all cells which match the value in "Ai" and delete the rows. Once this is done (and the find function errors) the value for i should increment by 1 and do it again. Note, there may be multiple entries for a value in "Ai"
Many thanks
For i = 2 To 100
Do
On Error GoTo A1
Cells.Find(What:=(Worksheets("Prices out put").Range(Cells(i, 1)).Value), After:=ActiveCell, LookIn:=xlValues _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Resize(Worksheets("Prices out put").Range(Cells(i, 2)).Value, 1).Select
Selection.Delete Shift:=xlUp
Loop
A1:
Resume B1:
B1:
Next
End Sub