Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Macro to transpose names, addresses

How do I record a macro to transpose over 100 names and addresses in column A
of a worksheet to separate columns for a mail merge set up? i.e., column B =
name, column C = street, etc. I can record the copy, paste special,
transpose action, but I need to repeat for each of the 100 names, addresses,
incrementing down 3 rows to copy the next address and then down 1 row to
transpose/paste that address in columnar mail merge format.
--
DSM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro to transpose names, addresses

Dave

Sub ColtoRows()
Dim Rng As Range
Dim I As Long
Dim j As Long
Dim nocols As Long
Set Rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
On Error Resume Next
nocols = InputBox("Enter Number of Columns Desired")

For I = 1 To Rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(I, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(Rng.Row, "A")).ClearContents

End Sub


Gord Dibben MS Excel MVP

On Sat, 2 Jun 2007 15:24:02 -0700, Dave wrote:

How do I record a macro to transpose over 100 names and addresses in column A
of a worksheet to separate columns for a mail merge set up? i.e., column B =
name, column C = street, etc. I can record the copy, paste special,
transpose action, but I need to repeat for each of the 100 names, addresses,
incrementing down 3 rows to copy the next address and then down 1 row to
transpose/paste that address in columnar mail merge format.


Reply
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
names ans addresses bobbydog New Users to Excel 8 March 17th 09 09:12 PM
Names and addresses Steve Excel Worksheet Functions 5 July 30th 08 12:50 PM
Using Macro to Sort Names, Numbers & addresses Tareq Excel Worksheet Functions 1 March 1st 05 02:08 PM
Contacts' names & addresses Thijs Excel Discussion (Misc queries) 1 February 24th 05 01:16 AM
Range names and their associated addresses Almamba Excel Worksheet Functions 1 January 9th 05 01:16 AM


All times are GMT +1. The time now is 09:36 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"