Does anyone have a macro that will delete entire row if column a matches column d
Does anyone have a macro that will delete entire row if column a matches column d
Last edited by martinez_pedro; 08-19-2009 at 01:33 PM.
hi Martinez_Pedro,
Do you mean something like this?
Please Login or Register to view this content.
Hey Paul I get a run time error 424 with the code you posted
But here is some sample data, on the real spreadsheet it can be up 26000 rows
Not sure why you get the error, but I see an issue with the code anyway (when deleting rows in VBA you should start at the bottom of the list so rows aren't skipped with the loop counter is incremented). Try this code instead:
Please Login or Register to view this content.
I try the second code and still saying
Run Time Error 424 - Object Required
Then I get the option debug or cancel if click debug it points at
For i = UsedRange.Rows.Count To 1 Step -1
do you thing its something worng with my excel(2007)?
I'm guessing you placed the code I gave you into a module rather than in the worksheet for which it applies. If you want to keep it in the module, you have to reference a sheet name or activesheet, e.g.
Please Login or Register to view this content.
I use the activesheet it work perfectly thank you very much
worked like a charm for me thanks for the post
What if the columns don't match up, but contain some of the numbers? For example, I'm scanning barcodes into an excel file, but would like a macro to take the numbers in a column from scanning, check a different column to see if those numbers match, and then delete the row that has a match. Column B is in order: 1,2,3,4,5,6, etc. Column C is not: 6,12,3,7,etc.
Thanks!
MGalessi, per the Forum Rules (link in my signature below) please start your own thread for this question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks