Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wonder if anybody can explain this?
In developing a new program I declared a variable with indeterminate dimension at module level (to make it available to any procedure) (e.g. Dim variable() ). I then reDimmed it at procedure level (to reinitialise the values before working with it €“ i.e. reDim variable(array size)). Then I used it within another procedure (e.g. sub AnotherProcedure()€¦€¦. variable(subscript) = a value€¦€¦end sub, and it worked exactly as expected. I then renamed "AnotherProcedure()" as I had rejigged the flow of the program e.g. to sub DifferentName, only to find that it no longer recognised the Dimmed variable within the module and came out with an error (subscript out of range). I then decided instead to create a new procedure with the required name, then copy the old contents into it and it worked fine again!! Is there a reason for this or is it some unknown quirk of Excel VBA? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Load a static array at procedure level | Excel Programming | |||
Using macro to convert single level BOM to Multi Level BOM | Excel Programming | |||
Stopping a 'multi-level' procedure | Excel Programming | |||
Declaring array constants at module level | Excel Programming | |||
Why, when I create workbook-level name does it jump it to Sheet-level ? | Excel Programming |