Jack-P-Winner
Member
I would like to know how to read this code so I can make some changes.
What is t?
What is x?
I assume r is row? but how is it used in this Macro
What does Dim x
Thanks for your help, my goal is I want to change the row it starts on and also place the digits in 3 columns instead of spreading them over 20+ columns. I have 48 digits that get spread out across 38 columns and I am trying to get them to be in groups of 3 digits so like they would go in BCD and go down as many rows as needed. I guess in this case 16 rows 16x3=48
What is t?
What is x?
I assume r is row? but how is it used in this Macro
What does Dim x
Thanks for your help, my goal is I want to change the row it starts on and also place the digits in 3 columns instead of spreading them over 20+ columns. I have 48 digits that get spread out across 38 columns and I am trying to get them to be in groups of 3 digits so like they would go in BCD and go down as many rows as needed. I guess in this case 16 rows 16x3=48
Code:
Sub SplitData()
Dim x As Long, t As Long
For Each r In Range("A:A").SpecialCells(xlCellTypeConstants)
t = 1
For x = 1 To Len(r.Value)
If Mid(r.Value, x, 1) Like "[0-9]" Then
t = t + 1
Cells(r.Row, t).Value = Mid(r.Value, x, 1)
End If
Next
Next
End Sub
[CODE]