title: Populate VBA Array with list of values in native code
body: <p>Hoping there is a quick answer to this question....</p>
  
  <p>I have an array and I want to populate it with a list of arguments.</p>
  
  <pre><code>Sub EasyArrayInput()
  Dim myArr() as variant
  myArr = ("string1", "string2", "string3")
  End Sub
  </code></pre>
  
  <p>I am well aware of how to loop through and populate with a for/next or do/while, but it would be nice to be able to populate an array when the values wont change without using a hardcoded method.</p>
  
  <pre><code>Sub UsualMethodThatIDontWantToDo()
  Dim myArr(1 to 3) as variant
  myArr(1) =  "string1"
  myArr(2) =  "string2"
  myArr(3) =  "string3"
  End Sub
  </code></pre>
  
  <p>Is there anyway to do it in a method similar to the first code snippet?  I would prefer to do it that way.  I apologize if this question has been asked/answered, but I'm not quite sure what the method I am asking about is called.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edit: Solution</strong></p>
  
  <p>The code snippet below (from the link that chancea sent) will create an array that is a variant and exaclty what I wanted.  </p>
  
  <pre><code>Sub EasyArrayInput()
  Dim myArr() as variant
  myArr = Array("string1", "string2", "string3")
  End Sub
  </code></pre>
  
  <p>The next code snippet looks to be useful for if you only have strings and don't want to initialize a variant:</p>
  
  <pre><code>Sub EasyArrayInput()
  Dim myArr() as String
  myArr = Split("String1,String2,String3", ",")
  End Sub
  </code></pre>