How can I populate a public array with static text values.

USAMax

Well-known Member
Joined
May 31, 2006
Messages
843
Office Version
  1. 365
Platform
  1. Windows
I understand how to create an array within a routine:

CurOptions = Array("M1", "M3", "M3 DSR", "L1", "L2", "CSA")


But I need the array to be public as the array can hold one of 6 different sets of values so I will declare the array to be only used within the module as:

Dim CurOptions(30)


Later I need to fill in the values manually, they will not be copied in, they need to be provided in a list.

It should be just one line,

Thank you,
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I found a way but it is not pretty. Is there any other way than this to populate a public array other than this?

COA(0) = "M1": COA(1) = "M3": COA(2) = "M3 DSR": COA(3) = "L1": COA(4) = "L2": COA(5) = "CSA"
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top