For ... next

  • Thread starter Thread starter TTTomek
  • Start date Start date
T

TTTomek

Hello,

I have my data in two columns, just like below:

a b
c d
e f
....

How can I do the data in one column but in this order:
a
b
c
d
e
f
....

Thank you in advance for any help.

Tomek
 
Hello,



I have my data in two columns, just like below:



a b

c d

e f

...



How can I do the data in one column but in this order:

a

b

c

d

e

f

...



Thank you in advance for any help.



Tomek

Where a, c, e are in K1, K2, K3,
b, d, f are in L1, L2, L3.


K4 =OFFSET(K1,0,1) and pull down.

Regards,
Howard
 
Hi,

Am Fri, 22 Feb 2013 07:07:07 -0800 (PST) schrieb TTTomek:
I have my data in two columns, just like below:

a b
c d
e f
...

How can I do the data in one column but in this order:
a
b
c
d
e
f

try:

Sub MoveData()
Dim LRow As Long
Dim i As Long

LRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = LRow To 2 Step -1
Rows(i).Insert shift:=xlShiftUp
Next
LRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LRow Step 2
Cells(i, 2).Cut Cells(i + 1, 1)
Next
End Sub


Regards
Claus Busch
 
Unfortunately something is wrong because after inserting this formula to "K4", "K1" gets selected but I can't do anything with it because I get information from excel that something is wrong with this formula.
But thank you very much for help.

Tomek
 
Unfortunately something is wrong because after inserting this formula to "K4", "K1" gets selected but I can't do anything with it because I get information from excel that something is wrong with this formula.

But thank you very much for help.



Tomek

Hmmm, where are you? Perhaps your version of Excel requires ";" instead of ",".

=OFFSET(K1;0;1)

Howard
 
Hmmm, where are you? Perhaps your version of Excel requires ";" instead of ",".



=OFFSET(K1;0;1)


Now the formula works, however the order of data is incorrect.

Tomek
 
Hmmm, where are you? Perhaps your version of Excel requires ";" instead of ",".



=OFFSET(K1;0;1)



Howard

I overlooked the order in which you posted.
You are in good hands with the code Claus offered.

Howard
 
Back
Top