2 columns -> 1 column

  • Thread starter Thread starter Danny Barak
  • Start date Start date
D

Danny Barak

Hello all
I have 2 columns and i want to make a 1 column as follows:
a b a
c d b
e f => c
g h d
i j e
.. f
.. g
.. h
.. i
.. j

Any help would be appreciated.
Danny
 
Danny

Sub CombineCols()
''combine 2 columns to one with data from Col 2 being inserted
''between data from Col 1
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).EntireRow.Select
ActiveCell.EntireRow.Insert
ActiveCell.Select
ActiveCell.Value = ActiveCell.Offset(-1, 1).Value
ActiveCell.Offset(-1, 1).Value = ""
ActiveCell.Offset(1, 0).Select
Loop
End Sub

Gord Dibben Excel MVP
 
Back
Top