I have 4 different ranges. I need to split the contents of these ranges. so the cell contains; Tom Jerry Bugs Bunny Jack Sparrow Bob. And I want to split that into 7 different cells. I have looked on the internet and have discover how to perform a split like this with the following code.
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
My issue is i need this inside a loop so it will go through a range, say ("H1:H200") and this is were I am stuck, I have started the loop, but cannot get the split to work inside it. Here is the start of my loop:
Dim rCell As Range
Dim rRng As Range
Set rRng = Range("H1:H200")
For Each rCell In rRng.Cells
'split string here.
Any help on this issue would be appreciated! Thanks.