copy text in multiple columns into one column

  • Thread starter Thread starter CherylH
  • Start date Start date
C

CherylH

I have the following:

Col #1 Col #2 Col #3
Z1 ZA ZM
Z2 ZB ZN

I want it to be in ONE column:
Col #1
Z1
Z2
ZA
ZB
ZM
ZN

Can I automatically do this vs. manually cutting and pasting?

Thanks in advance for any help!
Cheryl
 
Cheryl
This macro will do what you want. This macro operates with Columns A:C
putting all in Column B and Column C into Column A along with what was in
Column A to start. HTH Otto
Sub ShiftData()
Dim rColB As Range
Dim rColC As Range
Set rColB = Range("B1", Range("B" & Rows.Count).End(xlUp))
Set rColC = Range("C1", Range("C" & Rows.Count).End(xlUp))
rColB.Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
rColC.Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
Columns("B:B").ClearContents
Columns("C:C").ClearContents
End Sub
 
Otto,
Many thanks! This worked perfectly!

Otto Moehrbach said:
Cheryl
This macro will do what you want. This macro operates with Columns A:C
putting all in Column B and Column C into Column A along with what was in
Column A to start. HTH Otto
Sub ShiftData()
Dim rColB As Range
Dim rColC As Range
Set rColB = Range("B1", Range("B" & Rows.Count).End(xlUp))
Set rColC = Range("C1", Range("C" & Rows.Count).End(xlUp))
rColB.Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
rColC.Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
Columns("B:B").ClearContents
Columns("C:C").ClearContents
End Sub
 
Back
Top