Count cells with VBA in Microsoft Excel

The two worksheet functions Count () and CountBlank () are useful when you want to determine how many numbers or empty cells are in a range of cells.

Sub Zaehlen()
ThisWorkbook.Worksheets("Tabelle2").Activate
Range("E6").Value = Application. _
WorksheetFunction.Count(Range("E1:E5"))
Range("E10").Value = Application. _
WorksheetFunction.CountBlank(Range("E1:E9"))
End Sub

The Count () function determines how many cells in the range E1 to E5 contain numbers or dates. In the example this applies to cells E1 and E4. The CountBlank () function counts the number of empty cells in the range E1 to E9. In the example this applies to cells E7 to E9.

Was the explanation to "Count cells with VBA in Microsoft Excel"Helpful? Rate now:

Weitere Erklärungen zu Skriptsprachen