question

JonathanBrotto-3536 avatar image
0 Votes"
JonathanBrotto-3536 asked JiachenLiMFST-9349 answered

Copy cell range and only put unique values in another sheet

I am working on a master sheet that will generate several reports that will be on other sheets and I want to fetch only unique values such as the customer name and product group as shown in the picture.

Even though I programming in VB.net any code in C# will work for me.

From master sheet
165261-customer-name.png
165226-product-group.png


Then unique and/distinct names in the other sheets for each report
165271-customer-name-in-new-sheet.png
165262-product-group-in-new-sheet.png


dotnet-visual-basicoffice-vba-devoffice-scripts-excel-devoffice-vsto-com-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JiachenLiMFST-9349 avatar image
0 Votes"
JiachenLiMFST-9349 answered

Hi @JonathanBrotto-3536 ,
You can refer to the following question to get unique values.
Quicker way to get all unique values of a column in VBA?
And use Range.Copy method (Excel) to copy the range to the specified range.
Best Regards.
Jiachen Li


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.