title: VBA copy values from one array and store them into another
body: <p>I am hoping to find help with this current VBA problem. I have looked throughout Stack Overflow and other Google searches, but can't seem to find what I'm looking for.</p>
  
  <p>Essentially, I have a user pasted value on my page which I am delimiting on a comma, and then storing that into an array. What I am aiming to do is then loop through that array and eliminate any extra spaces, and then also delete any values that AREN'T a number.</p>
  
  <ol>
  <li>Copy user values</li>
  <li>Store into an array</li>
  <li>Erase whitespace</li>
  </ol>
  
  <p>So far, I have not been able to:</p>
  
  <ol start="4">
  <li>Copy items that ARE a number to new array</li>
  </ol>
  
  <p>Currently, my code looks like:</p>
  
  <pre><code>Sub grabText()
  
  ' This macro was written as a test macro to grab and filter data entered in a textbox
  
      Application.ScreenUpdating = False
  
      Dim enteredValue As String ' Value taken from page
      Dim vals() As String ' Array once it is split
      Dim goodvals() As String 'Formatted array
      Dim i As Integer 'Index
  
      enteredValue = ActiveSheet.myTxt.Text
     ' MsgBox enteredValue
  
      vals() = Split(enteredValue, ",")
  
      lastitem = UBound(vals)
     ' MsgBox lastitem
  
      'Formats array
      For i = LBound(vals) To UBound(vals)
          i = TRIM(vals(i))
          '
          '   If (ISNUMBER(vals(i)) == TRUE) Then
          '       enter i into goodvals()
          '
      Next i
  
      Application.ScreenUpdating = True
  </code></pre>
  
  <p>Any help or advice would be greatly appreciated. I was thinking about ways to do this in other languages (Java, Python) and I was thinking about Linked-Lists.</p>
  
  <p>Thanks in advance!</p>