Use count function to count array
Sub Array3() Dim Data(10) As Integer Dim Message As String, i As Integer For i = LBound(Data) To UBound(Data) Data(i) = i Next i MsgBox "Num Elements = " & WorksheetFunction.Count(Data) End Sub