• 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.

Unique Data Value Count in Excel macro needed

webmax

Member
Hi
I have country name Data in A column.

I have already put the Output Data in C2 Cell using formula.
Now i am using the formula but need for this formula with used range count in A cell.
Example now i have a data in A2:A8 Cell. But if i add more data then the formula will add to the used range (Available data using macro)

Attaching the file for your reference.

Thanks
 

Attachments

  • unique data count in vba macro.xlsx
    10 KB · Views: 5
Hi,​
as best option is post #2 but anyway an useless VBA demonstration :​
Code:
Sub Demo00()
    [C2].Value2 = Evaluate(Replace("SUM(1/COUNTIF(A2:A#,A2:A#))", "#", [A1].CurrentRegion.Rows.Count))
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Hi,
Using VBA codes, I created a macro that finds the count of unique values. You can run the CountUniqueValues macro in the Macro window that opened by pressing the Alt + F8 keys.

75857

I edited and attached your file.
 

Attachments

  • unique_data_count_in_vba_macro.xlsm
    15.7 KB · Views: 7
Back
Top