Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load a static array at procedure level
I am using Office 2003 on Windows XP.
I am trying to load a static array with data as follows: At module level: Private msColTotals() as String In procedu ReDim msColTotals(7) msColTotals = Array("L", "X", "Y", "AA", "AB", "AF", "AJ") But this fails. Can someone please post example code to fix this so it will run? Thanks much in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load a static array at procedure level
Private msColTotals() as String
becomes Private msColTotals as Variant And you can drop the ReDim statement, too. That way you don't have to worry when you add another column. If you need to loop through the array: Dim iCtr as long for ictr = lbound(msColTotals) to ubound(msColTotals) .... next ictr XP wrote: I am using Office 2003 on Windows XP. I am trying to load a static array with data as follows: At module level: Private msColTotals() as String In procedu ReDim msColTotals(7) msColTotals = Array("L", "X", "Y", "AA", "AB", "AF", "AJ") But this fails. Can someone please post example code to fix this so it will run? Thanks much in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lookup from Static List/Array | Excel Worksheet Functions | |||
keeping a sum array static | Excel Worksheet Functions | |||
Static and Dim outside procedure | Excel Programming | |||
Stopping a 'multi-level' procedure | Excel Programming | |||
Declaring array constants at module level | Excel Programming |