Hi,
I am trying to count the number of Z's in my range using vba, with msgbox.
I have set my range but cannot get the code to count just Z's.
Any ideas?
Thank you
Z
Hi,
I am trying to count the number of Z's in my range using vba, with msgbox.
I have set my range but cannot get the code to count just Z's.
Any ideas?
Thank you
Z
Why do you need VBA? just use a =COUNTIF() formula
I have a VBA code that I am trying to add the countif formula to, to automate the process.
You can access worksheet functions through the WorksheetFunction class - don't forget to escape your quotation marks though.![]()
Dim numberOfZ As Integer numberOfZ = WorksheetFunction.CountIf(myRange, """*z*""")
You can access worksheet functions through the WorksheetFunction class - don't forget to escape your quotation marks though.![]()
WorksheetFunction.CountIf(myRange, """*z*""")
Thanks S O. That works great, with the msgbox.
Z
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks