VBA/Excel/Access/Word/Data Type Functions/IsArray

Материал из VB Эксперт
Перейти к: навигация, поиск

Is a variable an array

 
Sub ArrayTest()
    Dim intNum1 As Integer
    Dim intNum(1 To 10) As Integer
    Debug.Print "intnum1: " & IsArray(intNum1)
    Debug.Print "intnum: " & IsArray(intNum)
End Sub



Using the IsArray Function

 
Sub IsThisArray()
    Dim tblNames() As String
    Dim totalTables As Integer
    Dim counter As Integer
    totalTables = 10
    ReDim tblNames(1 To totalTables)
    If IsArray(tblNames) Then
         MsgBox "The tblNames is an array."
    End If
End Sub