Count cells that are not blank

Macro Title:
Worksheet Variable:
Worksheet Name:
Range Reference:
range from which you want to count the number of non blank cells
Output Cell:
First Comment:

'
Second Comment:

'
Sub Count_cells_that_are_not_blank()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to count cells that are not blank
ws.Range("C13") = Application.WorksheetFunction.CountA(ws.Range("C5:C11"))

End Sub

Sub Count_cells_that_are_not_blank()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Analysis")
'apply the formula to count cells that are not blank

ws.Range("C13") = Application.WorksheetFunction.CountA(ws.Range("C5:C11"))

End Sub

Sub Count_cells_that_are_not_blank()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to count cells that are not blank
ws.Range("C13") = Application.WorksheetFunction.CountA(ws.Range("C5:C11"))

End Sub