View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Fill an Array with String values

John,

Dim a

a = Array("String1", "String2", "String3" ....."String20" )

Don't pre-dimension it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John Michl" wrote in message
...
Simple question. How do I load a list of strings into an array?

I know I code so the following but it seems inefficient.

Dim a (1 to 20) as String

a(1) = "String1"
a(2) = "String2"
etc...

Can I do something like...

a(1 to 20) = "String1", "String2", "String3" ....."String20"

or

a = Array("String1", "String2", "String3" ....."String20" )

Thanks.

- John Michl
www.JohnMichl.com