View Single Post
 
Old 06-01-2021, 04:36 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think you need to iterate through the array and test each value
Code:
Sub CountIt()
  Dim arr() As String, i As Integer, iCount As Integer
  arr = Split("1,Dog,2,Apple,3.7,22,Green", ",")
  For i = LBound(arr) To UBound(arr)
    If IsNumeric(arr(i)) Then iCount = iCount + 1
  Next i
  MsgBox "Array contains " & iCount & " numbers", vbOKOnly
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote