Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excell Macro help

I have text in a spreadsheet, not wrapped text but single line per row.
I wish to create a macro that will copy and paste th
address/state/zip/phone info into seperate cols to the right of th
name.
I have created a macro that will only paste to Row #1.

HOW.... do I designate the selected box(ie name #2 or cell #A2) to b
the starting point for the macro as I work down the page.

(Current)
Bob Smith
1234 turkey Ave
Putsville, UT
12345
(999)999-9999

Bill Smith
1235 Hen peck road
butte, Mt
65432
(999) 555-5555

(Wanted in 5 cols)
Bob Smith/1234 turkey ave/putsville, UT/12345/(999)999-9999
Bill Smith/1235 Henpeck Rd/etc...........get the idea?

The macro will cut and paste in different cells on the same row bu
repeats itself to the original row when I procede down the page.
I built a macro but it is tied to the original cell number.
How do I lose the cell number distinction so I can work my way down th
document. I have 300 of these....
PLEASE HELP,
Do

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Excell Macro help

Don,

Suffice to say, ensure that you have a backup of your data
before executing this macro.

The macro keys off of the active cell and works its way
down the active cell column. Select a cell in the first
block of data that you want to change. I assume this is at
the top of the list. The macro programmatically transfers
the data and then deletes the unnecessary rows. It does
not select nor copy and paste. There is no need to.

Sub TransposeToCols()
Dim Rng As Range, C As Range
Dim i As Integer
Set Rng = ActiveCell.CurrentRegion
i = 0
Application.ScreenUpdating = False
Do Until Rng(1) = ""
For Each C In Rng
i = i + 1
Rng(1, i) = C
Next
Range(Rng(2), Rng(i + 1)).EntireRow.Delete
Set Rng = Range(Rng(2), Rng(2).End(xlDown))
i = 0
Loop
Application.ScreenUpdating = True
End Sub

Regards,
Greg


-----Original Message-----
I have text in a spreadsheet, not wrapped text but single

line per row.
I wish to create a macro that will copy and paste the
address/state/zip/phone info into seperate cols to the

right of the
name.
I have created a macro that will only paste to Row #1.

HOW.... do I designate the selected box(ie name #2 or

cell #A2) to be
the starting point for the macro as I work down the page.

(Current)
Bob Smith
1234 turkey Ave
Putsville, UT
12345
(999)999-9999

Bill Smith
1235 Hen peck road
butte, Mt
65432
(999) 555-5555

(Wanted in 5 cols)
Bob Smith/1234 turkey ave/putsville, UT/12345/(999)999-

9999
Bill Smith/1235 Henpeck Rd/etc...........get the idea?

The macro will cut and paste in different cells on the

same row but
repeats itself to the original row when I procede down

the page.
I built a macro but it is tied to the original cell

number.
How do I lose the cell number distinction so I can work

my way down the
document. I have 300 of these....
PLEASE HELP,
Don


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excell Macro help

To Greg Wilson,
:)
1000 camels laden w/ treasure awaits you in heaven.
That was exactly what I had hoped for.
Your Macro script worked like a charm,
Thank you thank you thank you.....
Do

--
Message posted from http://www.ExcelForum.com

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
Macro Excell 03/07 Mike Excel Discussion (Misc queries) 2 January 5th 10 01:13 AM
Excell Macro Help Please Bill Kirk New Users to Excel 2 January 25th 06 09:22 PM
converting Lotus 123 macro to Excell macro mark h Excel Discussion (Misc queries) 6 July 11th 05 01:28 PM
Macro Text into Excell Krefty Excel Discussion (Misc queries) 2 December 20th 04 09:14 PM
macro crashes excell xp Todd[_5_] Excel Programming 2 September 5th 03 07:10 PM


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