transpose values

L

louie

hello! how do you transpose values example from C32:C44 of sheet1 to C3:O3 of
sheet2 using a macro?
i need to copy the values from selected columns(interval of 5, ex. Column
C,H,R,W and so on) then transfer them into rows of sheet 2?
 
S

Stefi

Try this macro:

Sub trpose5()
Sheets("sourcesheet").Select
destrow = 2
For coltocopy = 3 To 18 Step 5 'change 18 to No of really last column
destrow = destrow + 1
Range(Cells(32, coltocopy), Cells(44, coltocopy)).Select
Selection.Copy
Sheets("destsheet").Select
Cells(destrow, 3).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("sourcesheet").Select
Next coltocopy
End Sub

Regards,
Stefi


„louie†ezt írta:
 
L

louie

Hi Stefi,
Thank you so much! Can this be done programmatically? I also need to
transfer the names ex. B5 of sheet1= tom then paste it to A1 of sheet 2. And
I need to get data from multiple worksheets then transpose them into sheet2.
Example for A1:A10 data from sheet 1, A11 to A20 data from sheet 3 and so on.
A B C
1 tom 2 4
2 bri 3 1
11 blue 1 0
12 red 2 1

Regards,
Louie
 

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