Hi,
I need a macro to compare two cells in a row and delete the row if the cells are not the same. Not sure how to do this?
Thanks in advance
You can try with this code (in this example I work for rows 2 to 100 and I use column "a" and "b"):
Regards,For r = 2 to 100 If cells(r,"a") <> cells(r,"b") then rows(r).delete End If Next r
Antonio
Thanks for that- I've got about 20000 rows and it takes ages to go through them all. any way of speeding it up a bit?
Cheers
An update on this:
What i think i need is to go through only the range used in the worksheet and delete the row if two cells are the same value.
The reason for this is that the length of the spreadsheet will vary from time to time.
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks