string - Creating a fixed sting array in VBA -


i'm trying create multiple arrays containing our companies departments in vba. have basic coding skills cant seem syntax down right. trying do. ill post methods have tried.

dim bitman(2) string bitman(0) = "charlotte" bitman(1) = "raleigh" bitman(2) = "wilmington" 

and

dim bitman("charlotte", "raleigh", "wilmington") 

i have tried looking solution on here nothing has helped. seems basic , easy , know have logic down, need know how tell computer.

you can this:

'comma-separated list of {whatever want put in array} const mylist string = "charlotte,raleigh,wilmington"  sub foo()  dim bitman() string bitman = split(mylist, ",")  msgbox bitman(1) 'etc.  end sub 

i method, since provides simple place maintaining list, , don't need declare bounds of array, either. use method because arrays can't declared outside of procedure.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -