Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Array
How can I tell if an array declared initially as myArray() has yet been ReDim'ed?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Array
Dan,
You can test the lower or upper bound and trap the error that occurs if the array isn't dim'd. E.g, Dim N As Long On Error Resume Next N = LBound(Arr,1) If Err.Number = 9 Then Debug.Print "Arr not dim'd" End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "dan" wrote in message ... How can I tell if an array declared initially as myArray() has yet been ReDim'ed? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Array
Thanks Chip - already coded that I was hoping for a more elegant solution - oh wel
Thanks again |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Array
Just another idea then...
Sub Demo() Dim v As Variant ' etc If Not IsArray(v) Then ReDim v(1 To 10) End Sub -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "dan" wrote in message ... Thanks Chip - already coded that I was hoping for a more elegant solution - oh well Thanks again |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic Array
OP wrote
--How can I tell if an array declared initially as myArray() has yet been ReDim'ed? Dana DeLouis wrote: Just another idea then... Sub Demo() Dim v As Variant ' etc If Not IsArray(v) Then ReDim v(1 To 10) End Sub If it has been ReDim'ed (e.g., 1 to 5) then this code won't disclose that. Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic Sum Array Formula Input Help | Excel Discussion (Misc queries) | |||
Validation list via dynamic array in VBA | Excel Discussion (Misc queries) | |||
How to declare a dynamic array | Excel Discussion (Misc queries) | |||
see if dynamic array used | Excel Programming | |||
Q: Declaring a dynamic array | Excel Programming |