I want to count the number of cells in Column A which has some data in it.
let say if the data is form A1 to A23, then I should get 23 as the answer. In case there is a blank in between, then the result might change.
My try is below:
Option Explicit
Sub cntColA()
Dim Columncount As Integer
Columncount = Application.WorksheetFunction.CountA([A1:A2000])
MsgBox Columncount
Sheet1.Range("B1").Value = Columncount
End Sub