Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking Number of Dimensions In Array
Does anyone know how to check the number of dimensions of an already initialized array?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking Number of Dimensions In Array
Sub test()
Dim i As Long, j As Long Dim arr(1, 2, 3, 4) As Long On Error Resume Next i = 0 Do j = LBound(arr, i + 1) If Err.Number Then Exit Do Else i = i + 1 Loop Err.Clear On Error GoTo 0 MsgBox i End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "DigableP" wrote in message ... Does anyone know how to check the number of dimensions of an already initialized array? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking Number of Dimensions In Array
Smaller:
Sub test() Dim arr(1, 2, 3, 4) As Long Dim i As Long On Error Resume Next Do: i = i - (LBound(arr, i + 1) * 0 = 0): Loop Until Err.Number On Error GoTo 0 MsgBox i End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Rob van Gelder" wrote in message ... Sub test() Dim i As Long, j As Long Dim arr(1, 2, 3, 4) As Long On Error Resume Next i = 0 Do j = LBound(arr, i + 1) If Err.Number Then Exit Do Else i = i + 1 Loop Err.Clear On Error GoTo 0 MsgBox i End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "DigableP" wrote in message ... Does anyone know how to check the number of dimensions of an already initialized array? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checking a date/number between two others | Excel Discussion (Misc queries) | |||
Make list of cells in array and checking for duplicates | Excel Worksheet Functions | |||
number checking | Excel Discussion (Misc queries) | |||
number checking | Excel Discussion (Misc queries) | |||
Checking cell for Number | New Users to Excel |