I'm writing a method that will populate an array with data before pouring it into a worksheet (which is much faster than writing it in directly). But this time I want to preserve the array from one invocation to the next, which means the method must determine the status of the array. If it were an ordinary scalar variable I could use IsEmpty, but that doesn't work on an array. In fact, so far I haven't been able to figure out anything that works on an array that has been named in a Dim statement ("Dim ar()") but not yet hit the ReDim statement. Does anyone know how this can be done? What I want is something like this:But so far I don't see how to see whether the array has been initialized yet.
If /*array has not yet been initialized */ Then rZ = MaxRows ReDim ar(1 to rZ, 1 to cZ) /* populate the array */ End If