For ... next

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
 
L

lhkittle

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
 
C

Claus Busch

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
 
T

TTTomek

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
 
L

lhkittle

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
 
T

TTTomek

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
 
L

lhkittle

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
 

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