Hi
Try
Code:
Sub Splitt()
Dim splitVals As Variant
Dim totalVals, y As String
Dim i As Long, x
y = InputBox("Enter the delimiter character used (e.g., comma, semicolon, space...)")
If y = vbNullString Then Exit Sub
If Selection.Rows.Count > 1 Then
splitVals = Application.Transpose(Selection.Value2)
For i = 1 To UBound(splitVals)
x = Split(splitVals(i), y)
If UBound(x) > -1 Then
Selection.Cells(i, 1 + 1).Resize(, UBound(x) + 1) = x
End If
Next
ElseIf Selection.Cells.Count = 1 Then
x = Split(Selection.Value2, y)
If UBound(x) > -1 Then
Selection.Offset(, 1).Resize(, UBound(x) + 1) = x
End If
End If
End Sub
Bookmarks