LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Excel Macro to transpose addresses from rows to columns

I need to design a macro to transpose about 100+ addresses listed in column A
to 4 separate columns for name, street, and city/state/zip, & phone. The
macro needs to copy the 1st 4 lines of column 1 and then transpose to row 1
of 4 separate columns for a mail merge setup. Next, the macro needs to
increment down to row 5 of column 1 and transpose the next address to row 2
of the 4 mail merge columns.

The addresses are arranged like this in the first column:

The Little Laundrymat
1216 W. Dennis
Anytown, KS 12345
(888) 123-4567
Clean-It Cleaners & Coin Laundry
9514 Marshall Dr
Anytown, KS 12345
(888) 123-6754
De Soto Laundry
32505 Lexington Ave
Anytown, KS 12345
(888) 123-4765
Duds 'n Suds
6514 Martway St
Anytown, KS 12345
(888) 123-7654

The code looks like this below but I get a "1004 run-time error -
application defined or object defined error"

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 5/23/2007
'
'
x = 1
Do While Cells(x, C1).Value < ""
ActiveCell.Select
ActiveCell.FormulaR1C1 = "=TRANSPOSE(RC[-2]:R[3]C[-2])"
ActiveCell.Range("A1:D1").Select
Selection.FormulaArray = "=TRANSPOSE(RC[-2]:R[3]C[-2])"
ActiveCell.Offset(1, 0).Range("A1").Select
x = x + 4
Loop
End Sub

--
DSM
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transpose columns to rows using first columns repeated. hn7155 Excel Worksheet Functions 7 February 12th 09 11:50 PM
vba macro to perform custom reporting -transpose from rows to columns vba_newbie New Users to Excel 0 September 12th 07 01:28 PM
Macro to transpose names, addresses Dave Excel Programming 1 June 2nd 07 11:35 PM
transpose 255+ columns into rows? scottwilsonx[_64_] Excel Programming 0 October 25th 04 06:31 PM
Transpose Columns to Rows Rashid Khan Excel Programming 2 June 26th 04 09:49 PM


All times are GMT +1. The time now is 08:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"