Hi Guys & Gals,
I have attached a very interesting scenario with VBA code to remove duplicates. This code, I presume, is widely used, and yet, see how it can FALTER.
Is there any other more reliable approches I could consider?![]()
Hi Guys & Gals,
I have attached a very interesting scenario with VBA code to remove duplicates. This code, I presume, is widely used, and yet, see how it can FALTER.
Is there any other more reliable approches I could consider?![]()
Last edited by Winon; 11-18-2011 at 04:27 PM.
Filters (Auto and Advanced) require a header row.
Entia non sunt multiplicanda sine necessitate
Hello shg,
Thank you for responding.
What I do not understand though, is that the code never did this before, even without header rows.
Why the disparety between lists 1 and two?
The filter regards the first row as a header. 'Twas ever thus.
To back up shg (not that he needs it!)
Advanced filter is treating "COMMUTER 1" and "D/PACK" as headers and returns them, as D/PACK is also in the list (allowing for the header) you're getting what appears to be a duplicate.
You could try including the headers from Sheet2 (without the spare blank row), or just this.
![]()
Please Login or Register to view this content.
If you need any more information, please feel free to ask.
However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....
Also
اس کی مدد کرتا ہے اگر
شکریہ کہنے کے لئے سٹار کلک کریں
If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.
Thank you guys,
I am getting it now. But Please can you the explain why VP 1005 from List 2 also appears twice?
The second one has a trailing space.
Nice, I can definitely use this one.
Hi shg,
Please do not ask me how I missed that trailing space. Embarassing, to say the least. But then again it would require some vba checking and clearing when users make such mistakes. Or is it not do-able?
The VBA Trim function removes leading and trailing spaces.
Hi Internoob2,
Glad you like it, just make sure to take heed of what shg and Marcol suggested to improve on it. I did, and it now goes like a ROCKET!
Thank you shg,
Do you think there is a way to incorporate that Trim Function into the Module which Marcol so kindly amended to Header:=xlNo ?
I'm sure Marcol could do it for you readily, but just adding it in the remove duplicates code probably makes little sense. It should be performed at the appropriate point in the process flow when you collect the data.
You are just so helpfull shg,
Thank you.
Maybe I should try and see if I could do the VBA-Trim in the BeforeClose_Event of the WB the data is imported from. Promise to bother you again in this regard if I may.
Until later,
Take care !
You & Marcol were just absolutely fantastic in the pointers!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks