Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default column to row macro

morning all.
I have a text document that I've imported to Excel. It's on one row, across
approximately 1000 columns. I.e., out to AXD.

I need to move the cell contents for each into a single column-- A.

I'm thinking something along the line of-

dim i as integer

while activecell.value<""

select.offset(0,i).cut

select.offset(1,-i).paste

loop

Your helps are appreciated.
Thank you.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default column to row macro

No loop is needed:

Sub Steve()
Dim n As Long
n = Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(1, 1), Cells(1, n)).Copy
Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
End Sub

--
Gary''s Student - gsnu200906


"Steve" wrote:

morning all.
I have a text document that I've imported to Excel. It's on one row, across
approximately 1000 columns. I.e., out to AXD.

I need to move the cell contents for each into a single column-- A.

I'm thinking something along the line of-

dim i as integer

while activecell.value<""

select.offset(0,i).cut

select.offset(1,-i).paste

loop

Your helps are appreciated.
Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default column to row macro

k-ching!!!!! Wow.... all in one action too.

Thank you!!!!!!!!!
I'll have to read more on transpose.... that's a good one to know.
Have a great day.

"Gary''s Student" wrote:

No loop is needed:

Sub Steve()
Dim n As Long
n = Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(1, 1), Cells(1, n)).Copy
Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
End Sub

--
Gary''s Student - gsnu200906


"Steve" wrote:

morning all.
I have a text document that I've imported to Excel. It's on one row, across
approximately 1000 columns. I.e., out to AXD.

I need to move the cell contents for each into a single column-- A.

I'm thinking something along the line of-

dim i as integer

while activecell.value<""

select.offset(0,i).cut

select.offset(1,-i).paste

loop

Your helps are appreciated.
Thank you.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default column to row macro

Thanks for the feeedback.
--
Gary''s Student - gsnu200906


"Steve" wrote:

k-ching!!!!! Wow.... all in one action too.

Thank you!!!!!!!!!
I'll have to read more on transpose.... that's a good one to know.
Have a great day.

"Gary''s Student" wrote:

No loop is needed:

Sub Steve()
Dim n As Long
n = Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(1, 1), Cells(1, n)).Copy
Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
End Sub

--
Gary''s Student - gsnu200906


"Steve" wrote:

morning all.
I have a text document that I've imported to Excel. It's on one row, across
approximately 1000 columns. I.e., out to AXD.

I need to move the cell contents for each into a single column-- A.

I'm thinking something along the line of-

dim i as integer

while activecell.value<""

select.offset(0,i).cut

select.offset(1,-i).paste

loop

Your helps are appreciated.
Thank you.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default column to row macro

You don't even need to write code if you're only doing it once or twice -
just select the cells, right-click-cut, right-click-paste special, select
transpose.

"Steve" wrote:

k-ching!!!!! Wow.... all in one action too.

Thank you!!!!!!!!!
I'll have to read more on transpose.... that's a good one to know.
Have a great day.

"Gary''s Student" wrote:

No loop is needed:

Sub Steve()
Dim n As Long
n = Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(1, 1), Cells(1, n)).Copy
Range("A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
End Sub

--
Gary''s Student - gsnu200906


"Steve" wrote:

morning all.
I have a text document that I've imported to Excel. It's on one row, across
approximately 1000 columns. I.e., out to AXD.

I need to move the cell contents for each into a single column-- A.

I'm thinking something along the line of-

dim i as integer

while activecell.value<""

select.offset(0,i).cut

select.offset(1,-i).paste

loop

Your helps are appreciated.
Thank you.


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 that uses column headings as column sort 'buttons' Rob Benz Excel Programming 4 January 22nd 09 08:43 PM
A formula or macro that will place the date in an adjacent column Bany time something is typed in column A Mike C[_5_] Excel Programming 4 February 27th 08 01:57 AM
Macro - Insert&Label Column, if the labeled column doesn't exist Jeff[_43_] Excel Programming 1 December 15th 04 09:33 PM
Need Macro to Find Column Heading -- if none, then insert new column Jeff[_43_] Excel Programming 0 December 15th 04 07:08 AM
macro to transpose cells in Column B based on unique values in Column A Aaron J. Excel Programming 3 October 8th 04 02:29 PM


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