How do I transpose a vertical list 3300 rows into a horizontal rows make address labels? The macro I have used in the past is not working.
Thank you.Sub address() Dim myAreas As Areas, myArea As Range With Range("a1", Range("a" & Rows.Count).End(xlUp)) On Error Resume Next Set myAreas = .SpecialCells(2).Areas End With On Error GoTo 0 If myAreas Is Nothing Then Exit Sub For Each myArea In myAreas With myArea If .Rows.Count > 1 Then .Cells(1, 2).Resize(, .Rows.Count).Value = Application.Transpose(.Value) Else .Cells(1, 2).Value = .Value End If End With Next End Sub
Last edited by Leith Ross; 01-20-2012 at 06:25 PM. Reason: Added Code Tags
Hi LGRANT
the codes good but the else was in the wrong line
try
End SubSub address() Dim myAreas As Areas, myArea As Range With Range("a1", Range("a" & Rows.Count).End(xlUp)) On Error Resume Next Set myAreas = .SpecialCells(2).Areas End With On Error GoTo 0 If myAreas Is Nothing Then Exit Sub For Each myArea In myAreas With myArea If .Rows.Count > 1 Then .Cells(1, 2).Resize(, .Rows.Count).Value = Application.Transpose(.Value) Else .Cells(1, 2).Value = .Value End If End With Next
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
Thanks Pike. Not having any luck. I will look at the sites you suggest.
Thanks Pike. Not having any luck. I will look at the sites you suggest.
I suggest you post a small sample workbook.
File attached. 6 sheets to go. Thank you.
The problem is that the last 32,000-odd rows don't have any blanks between them!
The problem is that the last 32,000-odd rows don't have any blanks between them!
UGH, thank you!
So you have to tell us the logic for deciding where a new address starts.
After the row with a date in it.
After the row with a date in it.
got rid of the dates and some of the list transpses, but I get the 400 error. any ideas?
Suggest you post a revised workbook so we can see what you've done.
Suggest you post a revised workbook so we can see what you've done.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks