Macro to transpose column to row please.

S

Steved

Hello from Steved

I have
1
2
3
to be
1 2 3 please

I have several hundred to do, I do not mind placing the cursor on the first
line of the data and the macro highliting the next 2 rows down then
transposing it to the right.

As an example in column A1 1, A2 2, A3, 3
The macro when executed after I put the cursor in A1 it will then highlite
the 3 cells then transpose rows A2, A3 to B1, B2.

Thankyou.
 
S

Steved

Someting similar to below please.

Sub ToRow()
Range("Down 2").Select
Selection.Cut
Range("Right").Select
ActiveSheet.Paste
End Sub
 
R

Rowan

This should do what you have asked but if you have hundreds to do you
probably want to put it into some kind of loop:

With ActiveCell
.Resize(3, 1).Copy
.Offset(0, 1).PasteSpecial Transpose:=True
End With

Regards
Rowan
 
S

Steved

Hello Rowan from Steved

Thankyou.

Rowan said:
This should do what you have asked but if you have hundreds to do you
probably want to put it into some kind of loop:

With ActiveCell
.Resize(3, 1).Copy
.Offset(0, 1).PasteSpecial Transpose:=True
End With

Regards
Rowan
 
R

Rowan

Or like this to only transposte the 2 and 3:

With ActiveCell
.Offset(1, 0).Resize(2, 1).Copy
.Offset(0, 1).PasteSpecial Transpose:=True
End With
 
S

Steved

Thanks Rowan Yes 2, 3

Cheers.

Rowan said:
Or like this to only transposte the 2 and 3:

With ActiveCell
.Offset(1, 0).Resize(2, 1).Copy
.Offset(0, 1).PasteSpecial Transpose:=True
End With
 

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