I need a macro to delete unwanted data
Thanks Tom - the number of times you (and others) have told us this !
Hopefully I will remember in future.
"Tom Ogilvy" wrote:
Put a b in the first 3 cells and run it. You will find it skips rows. You
need to loop from the highest numbered row to the lowest numbered row.
For i = 3 To 1 Step -1
If Cells(i, "A") = "b" Then Cells(i, "A").EntireRow.Delete
Next
--
Regards,
Tom Ogilvy
"Toppers" wrote in message
...
Hi,
Something along these lines:
For i = 1 To 3
If Cells(i, "A") = "b" Then Cells(i, "A").EntireRow.Delete
Next
HTH
"Jason" wrote:
Hi all,
I need to design a macro in Excel that will delete all unwanted data.
For example: I have fields a,b,c,d. In field c my data is either
x,y,z. If data is y then I want to delete the entire row.
Thanks
|