I am using the following code to count the non-blank cells in various ranges, based on previously defined variables, and the first line of code is returning the correct count, but the next two are returning zero, when there are 14 non-blank cells in each defined range. In pointing to the variables, they are all set to the right values, so I am at a loss as to why they are returning zeros. What am I doing wrong??
Code:
Cells(lngRow, Over_30_Col) = Application.WorksheetFunction.CountA(Cells(3, Over_30_Col), Cells(lngRow - 1, Over_30_Col))
Cells(lngRow, NCR_Col) = Application.WorksheetFunction.CountA(Cells(3, NCR_Col), Cells(lngRow - 1, NCR_Col))
Cells(lngRow, Disp_Col) = Application.WorksheetFunction.CountA(Cells(3, Disp_Col), Cells(lngRow - 1, Disp_Col))