- Sep 27, 2013
- 8
- 0
- 0
Hey everyone,
I am new to this forum and relatively new to VBA programming so I hope that I can explain myself clearly enough that you all can understand.
Here it goes...
I have a spreadsheet that I import data into from a CAD packing that I use. When I extract the data from my CAD software, it inputs that data into columns in Excel. Specifically E, F and G. Depending on the number of drawings that I am pulling data from, I could have upwards of 3000 rows. Columns E, F and G are labeled Drawing Description 1, Drawing Description 2 and Filename, respectively. I then have to take those columns and transpose them so that Column E would now be row 11, Column F would be row 12 and Column G would be row 13. I have written the script to complete the steps that I just mentioned.
Code:
Sub Copy_Paste_Transpose2()
'
' Copy_Paste_Transpose2 Macro
' Copies, pastes and transposes data to be formatted for WDP editor
'
' Keyboard Shortcut: Ctrl+Shift+W
'
Dim lastrow As Long
lastrow = Range("E65536").End(xlUp).Row
Range("E11:G" & lastrow).Select
Selection.Copy
Range("I11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Application.CutCopyMode = False
End Sub
This was the easy part.
Now, my end goal is to move 3 rows of data, one column at a time, beginning with J11:J13, down to I14:I16. Then move K11:K13 to I17:I19 and so on until there is no more data to be moved from what was just transposed. Once I transpose Columns E, F and G, there could be an infinite amount of columns used, beginning with column I. Can anybody help me out with this?
I am new to this forum and relatively new to VBA programming so I hope that I can explain myself clearly enough that you all can understand.
Here it goes...
I have a spreadsheet that I import data into from a CAD packing that I use. When I extract the data from my CAD software, it inputs that data into columns in Excel. Specifically E, F and G. Depending on the number of drawings that I am pulling data from, I could have upwards of 3000 rows. Columns E, F and G are labeled Drawing Description 1, Drawing Description 2 and Filename, respectively. I then have to take those columns and transpose them so that Column E would now be row 11, Column F would be row 12 and Column G would be row 13. I have written the script to complete the steps that I just mentioned.
Code:
Sub Copy_Paste_Transpose2()
'
' Copy_Paste_Transpose2 Macro
' Copies, pastes and transposes data to be formatted for WDP editor
'
' Keyboard Shortcut: Ctrl+Shift+W
'
Dim lastrow As Long
lastrow = Range("E65536").End(xlUp).Row
Range("E11:G" & lastrow).Select
Selection.Copy
Range("I11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Application.CutCopyMode = False
End Sub
This was the easy part.
Now, my end goal is to move 3 rows of data, one column at a time, beginning with J11:J13, down to I14:I16. Then move K11:K13 to I17:I19 and so on until there is no more data to be moved from what was just transposed. Once I transpose Columns E, F and G, there could be an infinite amount of columns used, beginning with column I. Can anybody help me out with this?
