Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Say I've got an array of user-defined variables. I don't know how many
"slots" I'm going to need, so I dimension it as a dynamic array. Dim udtSheets() As MyDataType When I want to add a new slot, I get the UBound. ReDim Preserve udtSheets(UBound(udtSheets)+1) However, the first time I try this, I get a "subscript out of range" error because the zero-eth slot hasn't been done yet. I'm trying to find a VBA function that can tell me whether that has happened yet. Something like If HasBeenRedimmed(udtSheets) Then ReDim Preserve udtSheets(UBound(udtSheets)+1) Else ReDim Preserve udtSheets(0) End If I tried "IsArray" and it returns True even if there have been no slots used. For some reason I can't create my own function because Excel won't let me pass a UDT array as a function parameter. TIA. -- Hmm...they have the Internet on COMPUTERS now! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Determining number of values in an array (2 related questions) | Excel Programming | |||
Determining Array Limit | Excel Programming | |||
Dynamic Array | Excel Programming | |||
Dynamic 2D Array | Excel Programming | |||
see if dynamic array used | Excel Programming |