Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
lucky_lowell
 
Posts: n/a
Default mailing list transpose help

I have a flat text file that looks like this
Mr and Mrs Smith
19 Elm Street
Boston, Ma 01231

Mark Hanson
Kathy Elmstead
13 sycamore drive
Bolston Mt 91320

Mark and Linda Everett
342 Pine Street
Austin, Tx 53221

it goes on for about 500 entries

I'd love to get it into this format

Mr and Mrs Smith 19 Elm Street Boston Ma 01676
etc

any clever ideas

thanks
Lowell
  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

Lowell

To get into 3 or 4 columns per address.

Remember!! Always experiment on a copy of the sheet or book.

Public Sub AddressSort()
last = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
With Worksheets(1)
For x = last To 2 Step -1
If .Cells(x, 1).Value < "" And _
Cells(x - 1, 1).Value < "" Then
Range(.Cells(x, 1), .Cells(x, 10)).Copy _
Destination:=.Range(.Cells(x - 1, 2), .Cells(x - 1, 2))
Rows(x).Delete
End If
Next x
Range("A:A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End With
End Sub

Copied to a general module in your workbook.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.

Gord Dibben Excel MVP


On 29 Nov 2004 16:01:44 -0800, (lucky_lowell) wrote:

I have a flat text file that looks like this
Mr and Mrs Smith
19 Elm Street
Boston, Ma 01231

Mark Hanson
Kathy Elmstead
13 sycamore drive
Bolston Mt 91320

Mark and Linda Everett
342 Pine Street
Austin, Tx 53221

it goes on for about 500 entries

I'd love to get it into this format

Mr and Mrs Smith 19 Elm Street Boston Ma 01676
etc

any clever ideas

thanks
Lowell


  #3   Report Post  
lucky_lowell
 
Posts: n/a
Default

Gord,

Your in my prayers!
Fast Effecient Thoughtful
and able to solve the problem!!!!!!

Gord for President!

Regards
Lowell

Gord Dibben <gorddibbATshawDOTca wrote in message . ..
Lowell

To get into 3 or 4 columns per address.

Remember!! Always experiment on a copy of the sheet or book.

Public Sub AddressSort()
last = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
With Worksheets(1)
For x = last To 2 Step -1
If .Cells(x, 1).Value < "" And _
Cells(x - 1, 1).Value < "" Then
Range(.Cells(x, 1), .Cells(x, 10)).Copy _
Destination:=.Range(.Cells(x - 1, 2), .Cells(x - 1, 2))
Rows(x).Delete
End If
Next x
Range("A:A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End With
End Sub

Copied to a general module in your workbook.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.

Gord Dibben Excel MVP


On 29 Nov 2004 16:01:44 -0800, (lucky_lowell) wrote:

I have a flat text file that looks like this
Mr and Mrs Smith
19 Elm Street
Boston, Ma 01231

Mark Hanson
Kathy Elmstead
13 sycamore drive
Bolston Mt 91320

Mark and Linda Everett
342 Pine Street
Austin, Tx 53221

it goes on for about 500 entries

I'd love to get it into this format

Mr and Mrs Smith 19 Elm Street Boston Ma 01676
etc

any clever ideas

thanks
Lowell

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
link to result from drop down list dcruickshank Links and Linking in Excel 1 January 20th 05 10:57 PM
Making Mailing Labels Jerry Links and Linking in Excel 4 January 7th 05 05:09 PM
Drop down list Jinxy Excel Discussion (Misc queries) 3 November 29th 04 12:34 PM
Lookup closest number in list Jeff Excel Discussion (Misc queries) 6 November 26th 04 07:27 PM
Counting Repeated text or duplicates in a list Repeatdude Excel Discussion (Misc queries) 5 November 26th 04 07:10 PM


All times are GMT +1. The time now is 07:42 AM.

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

About Us

"It's about Microsoft Excel"