I currently have macro that removes any duplicates.But I would love to have the opposite, so it would delete all unique rows and would keep the ones that are duplicates.Please Login or Register to view this content.
Cheers
Rain
Is this possible?
I currently have macro that removes any duplicates.But I would love to have the opposite, so it would delete all unique rows and would keep the ones that are duplicates.Please Login or Register to view this content.
Cheers
Rain
Is this possible?
Last edited by rain4u; 02-03-2011 at 07:29 PM. Reason: typos
Hi rain4u,
Try this - just change the 'strMyCol' and 'lngStartRow' variables to suit and then run the macro initially on a copy of your data in case the results are not as expected:
Regards,Please Login or Register to view this content.
Robert
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
I only amended the col to E and title of the macro.
On exec it starts to think and then crashes, have to task manager and end it.Please Login or Register to view this content.
I do have 31000 lines on that spreadsheet.
Any solution?
A majority of the items in Column E must be unique as the 'rngDelRange' range is too large to set.
Try this, which though slower (as it deletes each row when needed to be deleted instesd of all at once at the end), should do the job:
RobertPlease Login or Register to view this content.
Another way:
Please Login or Register to view this content.
Last edited by shg; 02-04-2011 at 02:06 PM. Reason: correction
Entia non sunt multiplicanda sine necessitate
With shg-s code it prompts up compile error @User defined type not defined@
and highlights
With Roberts code it would probably remain doing it for longer periods. Was still going on after 5-10 min. Ended it then. And you are correct there are more uniques than duplicates.Please Login or Register to view this content.
Any ideas?
In the VBE, Tools > References > find and tick Microsoft Scripting Runtime
Hi shg
Could this be changed to remove all uniue rows, i.e. not leaving the lowest two values ?
example
rows with in column A = 1,2,3,3,4,4,4,5,5,6 would be left like 3,3,4,4,4,5,5
Cheers
David
Please start your own thread, David, and provide a link to this one if you like.
When you do, please post a workbook and explain in context.
Thanks.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks