I have an number of arrays:
mIOSconfig = Array(" ! *** SRMS *** ", "int *** PORT ***")
mCATOSconfig = Array(" ! *** SRMS *** ", "set port name *** DESC *** *** PORT *** ")
and I want to call these using external user input.
So assuming the user inputs “IOS” I want to use the mIOSconfig in future code.
So let’s supose the user’s input is stored in variable x.
x="IOS"
usedarray = "m" + x + "config"
somevarible = somefunction(usedarray)
msgbox (somevarible)
But this doesn’t work as the usedarray variable is a string and this is passed to the function not the array. How can I used the created usedarray varible to pass the array created at the start to the function?
Cheers
Aaron
As a workaround, you could use a collection to do what you want. Create a Collection object and
.Addthe arrays to the collection using “IOS”, “CATOS”, etc. as keys to the collection.As @Justin pointed out in his comment, what you are specifically trying to do is not supported by VBA.