Sub test1()
t = [A1:A1000000].Value
MsgBox GetTypeArray(t)
End Sub
Sub test2()
t = [A1:z1].Value
MsgBox GetTypeArray(t)
End Sub
Sub test3()
t = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
MsgBox GetTypeArray(t)
End Sub
Sub test4()
t = Split("toto,titi,riri,fifi", ",")
MsgBox GetTypeArray(t)
End Sub
Sub test5()
Dim t(0 To 3, 1)
MsgBox GetTypeArray(t)
End Sub
Sub test6()
Dim t(0 To 3, 0)
MsgBox GetTypeArray(t)
End Sub
Sub test7()
Dim t(0 To 3)
MsgBox GetTypeArray(t)
End Sub
Sub test8()
Dim t(1 To 3)
MsgBox GetTypeArray(t)
End Sub
Function GetTypeArray(t)
Dim Tx, X&, Z, x2
If LBound(t) = 0 Then x2 = UBound(t) + 1: X = x2 Else X = UBound(t): x2 = X
X = X * 2 / 2
Z = Switch(X = 1, "ligne", X = x2, "Colonne", X < x2 Or X > 1, "array")
If Z = "Colonne" And TypeName(Application.Index(t, 2, 1)) = "Error" Then Z = "array"
GetTypeArray = Z
End Function