Sub Macro2()
Range("A2:A" & Rows.Count).TextToColumns Range("B2"), xlDelimited, , , False, False, False, True, False
End Sub
Sub Macro2()
Columns("A").TextToColumns Range("B2"), xlDelimited, , , False, False, False, True, False
End Sub
Sub Macro3()
Dim Lr As Long, i As Long, j As Long, arr As Variant
Lr = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To Lr
arr = Range("A" & i).Value
Range("B" & i).Resize(, Len(arr) - Len(Replace(arr, ",", "")) + 1).Value = Split(arr, ",")
Next i
End Sub
Many thanks, this works perfectly. Also would it be possible for the macro to put headers on the created columns i.e. "Add1" "Add2".......Do you Change macro to This:
VBA Code:Sub Macro3() Dim Lr As Long, i As Long, j As Long, arr As Variant Lr = Range("A" & Rows.Count).End(xlUp).Row For i = 2 To Lr arr = Range("A" & i).Value Range("B" & i).Resize(, Len(arr) - Len(Replace(arr, ",", "")) + 1).Value = Split(arr, ",") Next i End Sub
Sub Macro3()
Dim Lr As Long, i As Long, j As Long, arr As Variant
Lr = Range("A" & Rows.Count).End(xlUp).Row
Range("B1").Resize(,3).Value = Array("Add1","Add2","Add3")
For i = 2 To Lr
arr = Range("A" & i).Value
Range("B" & i).Resize(, Len(arr) - Len(Replace(arr, ",", "")) + 1).Value = Split(arr, ",")
Next i
End Sub
thank you. this works nicely.Try This:
VBA Code:Sub Macro3() Dim Lr As Long, i As Long, j As Long, arr As Variant Lr = Range("A" & Rows.Count).End(xlUp).Row Range("B1").Resize(,3).Value = Array("Add1","Add2","Add3") For i = 2 To Lr arr = Range("A" & i).Value Range("B" & i).Resize(, Len(arr) - Len(Replace(arr, ",", "")) + 1).Value = Split(arr, ",") Next i End Sub