Addresses Transpose Macro

Parra

Well-known Member
Joined
Feb 21, 2002
Messages
752
Hi Everyone,

I have an address list 10,000 rows long (all info in column A) and I was hoping someone could help me with a macro that would transpose the data so that I can do a mailmerge.

There is no consistency with the data, it could be in 3, 4, 5 or more rows... the only pattern I see is that the begining data (the name) is bolded and the data ends at the next bolded name.

Currently I have been selecting and copying the bolded name down till the cell above the next bolded name, then I transpose the data... my fingers are killing me.

I would greatly appreciate your help.

Parra
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try

Code:
Sub XPose()
Dim LR As Long, i As Long, j As Long, k As Long
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = ActiveSheet
Set ws2 = Sheets.Add
With ws1
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To LR
        If .Range("A" & i).Font.Bold = True Then
            j = j + 1
            k = 1
        Else
            k = k + 1
        End If
        ws2.Cells(j, k).Value = .Range("A" & i).Value
    Next i
End With
End Sub
 
Upvote 0
There might or might not be an empty row, the data is messy.

I try the macro and post the results.

Thanks
 
Upvote 0
I will have to randomly check some of the data but it looks like your macro worked just fine :) Thanks VoG

Parra
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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