Pour test
Sub testy1()
Dim Res(0 To 2) As Variant
a = [A1:A7].Value
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy2()
Dim Res(0 To 2) As Variant
a = [A1:B7].Value
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy3()
Dim Res(0 To 2) As Variant
a = [A1:C7].Value
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy4()
Dim Res(0 To 2) As Variant
a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy5()
Dim Res(0 To 2) As Variant
a = Array([{1,"a"}], [{2,"b"}], [{ 3,"c" }], [{ 4,"d"}], [{5,"e"}], [{6,"f"}], [{7,"g"}], [{8,"h"}], [{9,"i"}])
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy6()
Dim Res(0 To 2) As Variant
Dim a(0 To 0, 0 To 0)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy7()
Dim Res(0 To 2) As Variant
Dim a(0 To 1, 0 To 0)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy8()
Dim Res(0 To 2) As Variant
Dim a(0 To 0, 0 To 1)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy9()
Dim Res(0 To 2) As Variant
Dim a(1 To 1, 1 To 1)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub test10()
Dim Res(0 To 2) As Variant
Dim a(1 To 1, 0)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy11()
Dim Res(0 To 2) As Variant
Dim a(0 To 5, 0)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub test12() '
Dim Res(0 To 2) As Variant
Dim a(0 To 5)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub
Sub testy13() '
Dim Res(0 To 2) As Variant
Dim a(0 To 5, 1 To 8)
NumberOfArrayDimensions a, Res
MsgBox "Variable tableau de type :" & vbCrLf & " --------> " & Res(0) & " dimensions" _
& vbCrLf & " --------> " & " En " & Res(1) _
& vbCrLf & " --------> " & " Nombre de Colonnes " & Res(2)
End Sub