• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hide Duplicate Cells

Danny

Member
Hi people

I am currently creating a large macro and was hoping someone might be able to help me.

I currently have a worksheet with a range of data on, a list of names followed by other user details. I want to copy that user name and paste it onto another worksheet.

Problem is the name is duplicated 5 or six times, is there a way of hiding the duplicates, copying the names to another worksheet and then un-hiding the names after?

Thank you in advanced
Danny
 
Hi,

since Excel 2007 there is the function Remove Duplicates in the Data menu …

So paste first the entire names column in another worksheet and then use the function to remove duplicates.

To see its VBA code, do it by using the Macro recorder ...
Or just read the VBA help of the Range.RemoveDuplicates method …​
 
Hi Marc

Thanks for getting back to me, I am aware of this function and have made use of it. However it appears this deletes the duplicates. I just want to hide them copy the unique values and then restore the duplicates.
 
Well read in sequence !

1) Paste the entire names columns on another worksheet.

2) On the active another worksheet, use the Remove Duplicates,
so the original worksheet stills the same !​
 
Yeah that's an idea, it gets around the problem. I was hoping for a script that could do it without adding new work sheets. However I can get a macro to do this an add it into the script I'm creating.

Thanks Marc
 

No need new worksheet ! Don't understand ! 'cause you wrote another worksheet :
[…] I want to copy that user name and paste it onto another worksheet.

Paste and Remove is the easy way.
Another way is to use an external system object like Dictionary (see MSDN) for example …
 
VBA is not my thing (yet). My thought was that when you consolidate duplicate rows, they are "hidden".
 
Back
Top