ringord
0
Q:

excel vba check for uninitialized or empty array

'In VBA an un-itialized array will raise a run-time error if
'code attempts to read from... or write to it.

'VBA function to test if an array is ready for access:

Function ArrayReady(a) As Boolean
    On Error Resume Next
    ArrayReady = Not LBound(a) > UBound(a)
End Function

'--------------------------------------------------------------------

'Arrays can be created in many ways. More ways than this:
'Dim v: v = Array()
'Dim v: v = [A1:B10]
'Dim v: Redim v(0 to 9)
'Dim v()
'Dim v(1 To 5, 1 TO 2)
2

New to Communities?

Join the community