Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default append multiple columns

I have a time consuming task and was trying to find a way to append multiple
columns of data (with blank cells) under column "A". Currently, my columns
have data out to column "M", but this may increase or decrease.

From:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3 Data X
4 Data 4 Data Z
5 Data 5
6 Data 6 Data Y

Into:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3
4 Data 4
5 Data 5
6 Data 6
7 Data X
8 Data Y
9 Data Z
10 ect.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default append multiple columns

Right click on sheet tab, view code. Paste this in, and run:

Sub Rearrange()
i = 1

'Runs from column A to M
For xColumn = 1 To 13
For xRow = 1 To Me.Cells(Me.Rows.Count, xColumn).End(xlUp).Row
If Not IsEmpty(Me.Cells(xRow, xColumn)) Then
'Alternatively, use this line:
'If Me.Cells(xRow, xColumn) < "" Then
Cells(i, 1) = Me.Cells(xRow, xColumn).Value
i = i + 1
End If
Next xRow
Next xColumn
End Sub

--
Best Regards,

Luke M
"Tony S." wrote in message
...
I have a time consuming task and was trying to find a way to append
multiple
columns of data (with blank cells) under column "A". Currently, my columns
have data out to column "M", but this may increase or decrease.

From:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3 Data X
4 Data 4 Data Z
5 Data 5
6 Data 6 Data Y

Into:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3
4 Data 4
5 Data 5
6 Data 6
7 Data X
8 Data Y
9 Data Z
10 ect.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default append multiple columns

That's a nice routine Luke. It works great. One question though... Is there a
way to modify the program to cut the data in columns B-M rather than copying
it, or do I need to delete that data manually after the program runs?

"Luke M" wrote:

Right click on sheet tab, view code. Paste this in, and run:

Sub Rearrange()
i = 1

'Runs from column A to M
For xColumn = 1 To 13
For xRow = 1 To Me.Cells(Me.Rows.Count, xColumn).End(xlUp).Row
If Not IsEmpty(Me.Cells(xRow, xColumn)) Then
'Alternatively, use this line:
'If Me.Cells(xRow, xColumn) < "" Then
Cells(i, 1) = Me.Cells(xRow, xColumn).Value
i = i + 1
End If
Next xRow
Next xColumn
End Sub

--
Best Regards,

Luke M
"Tony S." wrote in message
...
I have a time consuming task and was trying to find a way to append
multiple
columns of data (with blank cells) under column "A". Currently, my columns
have data out to column "M", but this may increase or decrease.

From:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3 Data X
4 Data 4 Data Z
5 Data 5
6 Data 6 Data Y

Into:
A B C etc. Thru Column "M"
1 Data1
2 Data 2
3 Data 3
4 Data 4
5 Data 5
6 Data 6
7 Data X
8 Data Y
9 Data Z
10 ect.



.

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
How can I append multiple sheets from mulitple xls. files. into 1 salem_gladiator Excel Discussion (Misc queries) 1 January 16th 09 11:02 PM
putting 2 long columns into multiple columns in excel page and sor bob_mhc Excel Discussion (Misc queries) 1 April 25th 08 07:51 AM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 0 July 31st 06 05:07 PM
How can you append text in multiple cells in excel? Shane New Users to Excel 4 October 19th 05 10:49 PM


All times are GMT +1. The time now is 03:08 PM.

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"