Access gives the following example for populating an array in VBA.
Dim MyWeek, MyDay
MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
' Return values assume lower bound set to 1 (using Option Base
' statement).
MyDay = MyWeek(2) ' MyDay contains "Tue".
MyDay = MyWeek(4) ' MyDay contains "Thu".
In VB.Net you can use the following
Dim rectangulararray as Integer(,) = {{0,1,2},{3,4,5},{6,7,8},{9,10,11}}
Is it possible in VBA to populate an multidimensional (in this case 2D) array in a similar fashion?
I am not looking for a loop statement as I have fixed values that I need to calculate relative locations of postcodes. I am attempting to Hard code in the values but this might not be the best way. Would storing them in a table and populating the array from there be better??
any help welcome.
Redapples
Want the best answers? See FAQ181-2886
Dim MyWeek, MyDay
MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
' Return values assume lower bound set to 1 (using Option Base
' statement).
MyDay = MyWeek(2) ' MyDay contains "Tue".
MyDay = MyWeek(4) ' MyDay contains "Thu".
In VB.Net you can use the following
Dim rectangulararray as Integer(,) = {{0,1,2},{3,4,5},{6,7,8},{9,10,11}}
Is it possible in VBA to populate an multidimensional (in this case 2D) array in a similar fashion?
I am not looking for a loop statement as I have fixed values that I need to calculate relative locations of postcodes. I am attempting to Hard code in the values but this might not be the best way. Would storing them in a table and populating the array from there be better??
any help welcome.
Redapples
Want the best answers? See FAQ181-2886