Using dynamic Unique Function

hishamkhatri

New Member
Joined
Oct 16, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,

This is my first post here and I could really use your help!

I'm working on a Macro right now. There is a list of values out of which I would be extracting unique values using =UNIQUE formula. Now, this formula needs to be dynamic because the list of values would be copy pasted by a user and it cannot be turned into Table everytime or else it'll be an extra work.

So, what I did is, I used the unique formula and referenced the entire Column but that results into having an extra value. "0 (Zero)" for all the blank cells. Is there a way, I can remove the 0 and only have cells that has value unified?

I used the same logic in GSheet and it didn't give me any trouble. My organization has recently migrated to M365 so, I need to convert my existing GSheet Macro into Excel Macro!

Could really use your help!

Thank you!
Hisham Khatri
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the MrExcel board!

I would not use a whole column reference unless you really have something like 1,000,000 rows of data. Just choose a range that will be big enough to cover any expected data.

So try something like
Excel Formula:
=UNIQUE(FILTER(A1:A10000,A1:A10000<>""))
 
Upvote 0
Welcome to the MrExcel board!

I would not use a whole column reference unless you really have something like 1,000,000 rows of data. Just choose a range that will be big enough to cover any expected data.

So try something like
Excel Formula:
=UNIQUE(FILTER(A1:A10000,A1:A10000<>""))

Thank you so much, Peter!!! It worked like a charm!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top