VBA to copy column data into rows

amxtomzo

Active Member
Joined
Nov 7, 2009
Messages
312
HI,
I am hoping to find an easier way to write this code. I have column data 34 rows long, about 140+/- coulns to get data from,on a couple worksheets. I was hopeing there was a better code that would copy them to rows. this will give us 1 or 2 pages of a reference chart to really help us double checking our manufacturing process.
Here is what I started to write, just cant help thinking there is a better way.

Sub VersionReferenceList()
Sheets("SameVersions").Select

Dim WST As Worksheet ' Data worksheet
Dim WSR As Worksheet ' Report worksheet
Set WST = Worksheets("SameVersions")
NEXTROW = 4
' Loop through all Columns to create chart with Like Versions & Total QTYs
FinalRow = 35
For i = 4 To FinalRow
' rearrange the data starting in AQ
Cells(NEXTROW, 43) = Cells(4, 9)
Cells(NEXTROW, 44) = Cells(5, 9)
Cells(NEXTROW, 45) = Cells(6, 9)
Cells(NEXTROW, 46) = Cells(7, 9)
Cells(NEXTROW, 47) = Cells(8, 9)
Cells(NEXTROW, 48) = Cells(9, 9)
Cells(NEXTROW, 49) = Cells(10, 9)
Cells(NEXTROW, 50) = Cells(11, 9)
Cells(NEXTROW, 51) = Cells(12, 9)
Cells(NEXTROW, 52) = Cells(13, 9)
Cells(NEXTROW, 53) = Cells(14, 9)

as you can see I am makeing a row equalling the data in column from column 9. this is the same worksheet.

This is a small part of what I will write, No I havn't finished writing it for all 140+ columns, just 5 or 6 so far.
If there is a better,shorter code to write, to copy column data that would be great

Thank you very much
Thomas
 
Try code like the following

Code:
Sub Xpose()
Range("A12").Resize(, 10).Value = Application.Transpose(Range("A1:A10"))
End Sub

Results:

Excel Workbook
ABCDEFGHIJ
12
29
31
44
54
65
77
810
91
101
11
1229144571011
Sheet2
 
Upvote 0
VoG

Once again you VoG, have made my life a lot easier, I can't tell you how much i brag about this web site and MrExcel books.

Thanks VoG, it will take a lot less time now to write this now
enjoy the rest of your weekend

Thomas
 
Upvote 0

Forum statistics

Threads
1,226,795
Messages
6,193,047
Members
453,772
Latest member
aastupin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top