Sep 17 2021 09:13 AM
I would like to count the number of blank cells in a column.
I am trying to do this via:
Set ws = Worksheets("Sheet1")
Set col = ws.Columns(1)
Application.WorksheetFunction.CountA(col)
This returns 888 for every column I have tried it on, whether or not there is lots of text-filled cells in the column or very few.
I think the issue might be that it is counting cells with empty strings in them as being non-empty.
Is there a count function which would consider a cell with an empty string in it as empty?
Thank you
Sep 17 2021 09:49 AM
Do you really want to count the number of blank cells in an entire column? That will probably be very high.
You could try
Application.WorksheetFunction.CountBlank(col)
or
Application.WorksheetFunction.CountIf(col, "")
Sep 17 2021 10:04 AM
Sep 17 2021 10:16 AM
Sep 17 2021 11:41 AM
Sep 20 2021 06:03 AM
Sep 20 2021 07:26 AM
> is the "greater than" comparison operator.
The condition "> " means "greater than a space". Non-blank entries will be greater than a space alphanumerically.