JACOBB9900
New Member
- Joined
- Apr 8, 2019
- Messages
- 38
Hello,
I need to apply my split macro to range of cells. I currently have cell D4 selected but I need the range D4:D100 to be affected by the macro. How do I type that range out? I've tried typing MyText=Range(Cells(3,4),Cells(100,4)) but it did not work. See below for my current macro.
Thank you.
Sub Split_Example1()
Dim MyText As String
Dim i As Integer
Dim MyResult() As String
MyText = Cells(3, 4)
MyResult = Split(MyText, ":", 3)
For i = 0 To UBound(MyResult)
Cells(3, i + 4).Value = MyResult(i)
Next i
End Sub
I need to apply my split macro to range of cells. I currently have cell D4 selected but I need the range D4:D100 to be affected by the macro. How do I type that range out? I've tried typing MyText=Range(Cells(3,4),Cells(100,4)) but it did not work. See below for my current macro.
Thank you.
Sub Split_Example1()
Dim MyText As String
Dim i As Integer
Dim MyResult() As String
MyText = Cells(3, 4)
MyResult = Split(MyText, ":", 3)
For i = 0 To UBound(MyResult)
Cells(3, i + 4).Value = MyResult(i)
Next i
End Sub