Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If an array is originally dim'd as: TestAy() as whatever
I can't find a way, in a subsequent macro where TestAy() is an argument, to directly test whether or not it has been re-dim'd. I have two macros, the first has a string array that is dim'd without boundaries. dim TestAy() as string IF sub MacroOne puts values into it, I use: redim TestAy(1 to Quantity) ' and then fill it with values. Now, MacroTwo is called call MacroTwo(TestAy()) sub MacroTwo(TestAy() as string) ' I've tried different ways, but keep getting subscript errors, when I try to ' test whether or not TestAy has values without also creating and ' passing another argument showing whether or not TestAy was ' redim'd in MacroOne. Some examples follow of stuff that didn't work ' when MacroOne did NOT redim TestAy. ' NOTE: I'm looking for a direct way, if it exists, to learn. I know that ' I could redim TestAy(1) in MacroOne and then in MacroTwo test ' TestAy(1) to see what it contained. if lbound(TestAy) 0 then ..... ' errors out if not dimmed dim Number number = vartype(TestAy) ' tells me it's an array but no boundaries Dim holdARRAY holdARRAY = Array(TestAy) MsgBox LBound(holdARRAY(1)) 'errors out if TestAy not redim'd. end sub Thanks for your help. -- Neal Z |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I test dynamic array for empty? | Excel Programming | |||
Can't test for Empty objects in an array | Excel Programming | |||
Test for dups in Array | Excel Programming | |||
Array Test | Excel Programming | |||
Test for end of array of objects? | Excel Programming |