From vertical address labels to horizontal list

Skarlett_One

New Member
Joined
Jan 10, 2018
Messages
14
I'm using Excel 2003, and I'm trying to go from address labels to a single line per household. I have nearly 10,000 lines to go through. Is there any way of doing it faster than copy/paste/delete ad nauseum. The original one looks like this

|Jane Doe
|123 Any Street

and I need it to be:

Jane Doe |123 Any Street| Postal Code| City

I don't know how to word it to search for this request. I've been searching for 2 days, and I can't find what I'm looking for. :confused::confused::confused:

Help?
 
Thank you. I tried this and it came back with Runtime error '9': Subscript out of range. I'm not sure what I did wrong?
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
A cell in column E. Should it have been in column A? I'm sorry, I've never used a macros like this before, so am totally lost.
 
Upvote 0
Ok....this is what it looks like before I've done anything to it:

Scott AllenAisha Rizwan & Rizwan ShahidPeter & Sylvia De Guzman
26 Panamount Street NW30 Panamount Street NW34 Panamount Street NW
Job: f06-018-0023 SR: 00008833Job: f06-018-0024 SR: 00009174Job: f06-018-0025 SR: 00014848
Nizar A. Walji & Hamid ShivjiLuanne TranPetty By Wu & Ken Lo
46 Panamount Street NW111 Panatella Close NW106 Panamount Rise NW (SP)
Job: f06-018-0028 SR: 00015045Job: f06-036-0054 SR: 00007994Job: f06-039-0048 SR: 00007521
Samuel & Julie LawYongsheng Wang & Yonghong SunEdward Chan & Jaylene Klaudt
110 Panamount Rise NW114 Panamount Rise NW (SP)194 Panamount Rise NW
Job: f06-039-0049 SR: 00007299Job: f06-039-0051 SR: 00007635Job: f06-039-0072 SR: 00007300

<colgroup><col><col><col></colgroup><tbody>
</tbody>

There's 2 spaces between each entry. Sometimes three. I need to somehow remove the "job" line and get the rest to be horizontal. I tried running the script again and it still came back with the same error. The highlighted row is the same. Results(N, 1) = Cells(R, C)
 
Upvote 0
Try this mod to Rick's code
Code:
Sub FixNameAddressLayout()
'Rick Rothstein
  Dim R As Long, C As Long, N As Long, LastCol As Long, LastRow As Long, Groups As Long, Results As Variant
[COLOR=#ff0000]  With Columns("A")
      .Replace "Job:*", "#N/A", xlPart, , False, , False, False
      .SpecialCells(xlConstants, xlErrors).EntireRow.Delete
  End With[/COLOR]
  LastCol = Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  Groups = Columns("A").SpecialCells(xlConstants).Areas.Count
  ReDim Results(1 To Groups * LastCol, 1 To 2)
  For R = 1 To LastRow [COLOR=#ff0000]Step [/COLOR][COLOR=#ff0000]4[/COLOR]
    For C = 1 To Cells(R, Columns.Count).End(xlToLeft).Column
      N = N + 1
      Results(N, 1) = Cells(R, C)
      Results(N, 2) = Cells(R + 1, C)
    Next
  Next
  Range("F1").Resize(UBound(Results), 2) = Results
End Sub
 
Upvote 0
It works for me in both xl2003 & 2013, so the version shouldn't be a problem.
Is your data laid out like this


Excel 2013 32 bit
ABC
1Scott AllenAisha Rizwan & Rizwan ShahidPeter & Sylvia De Guzman
226 Panamount Street NW30 Panamount Street NW34 Panamount Street NW
3Job: f06-018-0023 SR: 00008833Job: f06-018-0024 SR: 00009174Job: f06-018-0025 SR: 00014848
4
5
6Nizar A. Walji & Hamid ShivjiLuanne TranPetty By Wu & Ken Lo
746 Panamount Street NW111 Panatella Close NW106 Panamount Rise NW (SP)
8Job: f06-018-0028 SR: 00015045Job: f06-036-0054 SR: 00007994Job: f06-039-0048 SR: 00007521
9
10
11Samuel & Julie LawYongsheng Wang & Yonghong SunEdward Chan & Jaylene Klaudt
12110 Panamount Rise NW114 Panamount Rise NW (SP)194 Panamount Rise NW
13Job: f06-039-0049 SR: 00007299Job: f06-039-0051 SR: 00007635Job: f06-039-0072 SR: 00007300
Sheet2
 
Upvote 0
Yes, and sometimes there's 3 spaces in between.

I was able to get it to work by putting all the information into one column and then getting it to separate out from there. Now I have to try to sort it according to address. I tried sorting by ascending in column B, but it doesn't keep all the same subdivision street names together. Is there a macros for that as well?
 
Upvote 0
Now I have to try to sort it according to address. I tried sorting by ascending in column B, but it doesn't keep all the same subdivision street names together. Is there a macros for that as well?
Almost certainly, but that's beyond me.
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,634
Members
449,460
Latest member
jgharbawi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top