Hello,
I have single stack column that I need to turn in to a group of rows. However, number of rows that make up each group is variable but each group ends with an phone number field.
So I want to move the data over one column from the previous moved column including the phone number. After the phone number field is placed, I want the loop the begin with the name field in the first column and transpose the next group of data. I understand the the data will not be formatted correctly but I can fix that later.
I have code for delimiting on blank spaces:
Example of data in SOD (i.e. Civ):
Name
Address
Address1
Blah
Blah
(555)555-5555
Name
Address
(555)555-5555
Name
Address
Address1
Blah
(555)555-5555
Finish product will be:
Name Address Address1 Blah Blah (555)555-5555
Name Address (555)555-5555
Name Address Address1 Blah (555)555-5555
I found code here (thank you, watersev!) for delimiting on blanks. How do I modify it to find for my phone number field that is formatted as a text field?
Code to delimit on blanks below:
Sub test()
Dim myrange As Range, x
Application.ScreenUpdating = 0
On Error Resume Next
Set myrange = Range("a1", Cells(Rows.Count, 1).End(xlUp))
With myrange
.SpecialCells(xlCellTypeBlanks) = "$"
x = Split("|" & Join(Application.Transpose(myrange), "|"), "$")
With Range("d1").Resize(UBound(x) + 1)
.Value = Application.Transpose(x)
.TextToColumns DataType:=xlDelimited, other:=True, otherchar:="|"
End With
.Replace "$", "", xlWhole
End With
Application.ScreenUpdating = 1
End Sub
Bookmarks