Macro to Count Unique Values

spyldbrat

Board Regular
Joined
May 5, 2002
Messages
211
Office Version
  1. 365
I have a spreadsheet that has two sheets. The formula will appear on sheet 1 but I need to show the # of unique values in column b from sheet 2. There is a header on sheet 2 (row 1) so if the count is going to look at the entire column (B:B) then 1 needs to be deducted from the formula. Thanks in advance.

Thank yu a
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What version of Excel are you using?
Please update your account details to show this, as it affects what functions you can use.
 
Upvote 0
Thanks for that.
Do you need this to be a macro, you can just use
Excel Formula:
=ROWS(UNIQUE(Sheet2!B2:B10000))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
I'm not using Office 365, so don't have the UNIQUE function, what's the most efficient way for other versions of Excel?
 
Upvote 0
That depends on your data and your version of Excel.
However please start a thread of your own, rather than "hijacking" somebody else's.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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