View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default how do you interleave two columns

Sub columnmerge()

For i = 1 To 250
ActiveSheet.Cells(i, 3) = ActiveSheet.Cells _
((i + 1 - ((i + 1) Mod 2)) / 2, ((i + 1) Mod 2) + 1)
Next i

End Sub


Gord Dibben MS Excel MVP

On Tue, 12 Jun 2007 11:37:01 -0700, bobbe
wrote:

If you have two columns of data, what's the easiest way to automatically
(programatically?) interleave them. The resulting column should consist of:

1st cell of 1st column
1st cell of 2nd column
2nd cell of 1st column
2nd cell of 2nd column
etc.

For example,
1 a
2 b
3 c

would become:

1
a
2
b
3
c