title: VBA Code to split data in Range of Cells
body: <p>I have edited this question to add the code i already have.</p>
  
  <p>I need a VBA Excel code to split data in Cells.</p>
  
  <p>Split Rule : 
  1-   Whenever you find a space " " split and put it into the next column , then
  2-   Loop to the next row and do the same until Cell is blank i.e no more data. </p>
  
  <p>Please refer to the attached Image for example - Data to split in Column A and the result will be in the next columns.</p>
  
  <p>I tried the code below and it do the job but it doesn't loop to the next row , May you please edit this code to make it loop to next row and stop when there is no more data i.e. Blank Cell.  </p>
  
  <pre><code>Sub example()
  Dim text As String
  Dim a As Integer
  Dim name As Variant
  text = ActiveCell.Value
  name = Split(text, " ")
  For a = 0 To UBound(name)
  Cells(1, a + 1).Value = name(a)
  Next a
  End Sub
  </code></pre>
  
  <p>Thanks so much.</p>
  
  <p><a href="https://i.stack.imgur.com/QflTS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QflTS.png" alt="example"></a></p>