Append multiple columns

T

Tony S.

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 the 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
 
×

מיכ×ל (מיקי) ×בידן

One way will be with a VBA MAcro:
--------------------------
Sub Tony()
Application.ScreenUpdating = False
LR = ActiveSheet.UsedRange.Rows.Count
LC = ActiveSheet.UsedRange.Columns.Count
Ind = LR + 1
For C = 2 To LC
For R = 1 To LR
If Cells(R, C) <> "" Then
Cells(Ind, 1) = Cells(R, C)
Ind = Ind + 1
End If
Next
Next
Application.ScreenUpdating = True
End Sub
 
T

Tony S.

Sorry for the double post. My bad...
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? That
way the data can't be duplicated if it runs twice accidentally.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top