Good Evening All
Could you advise me on how to clean up the following code. I am trying to copy a set of range of cells from a sheet called ‘spool’ to sheet 1 but transpose the cells, so D1
4 will be copied to B2,C2,D2 and E2. Then the next E1:E4 will be copied F2.G2.H2,I2, then F1:F4 will go to J2,K2,L2,M2 and G1:G4 will go to N2,O2,P2 and finally Q2. I then move to the next line so D5
8 will be copied to B3,C3,D3,E3 and so on until the end of the document on spool sheet
Regards
Jupops
The code looks like:
Range("D1
4"
.Select
Selection.Copy
Sheets("Sheet1"
.Select
Range("B2"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Range("F2"
.Select
Sheets("spool"
.Select
Range("E1:E4"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("F1:F4"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("J2"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("G1:G4"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("N2"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("D5
8"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("B3"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("E5:E8"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("F3"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("F5:F8"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("J3"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
.Select
Range("G5:G8"
.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
.Select
Range("N3"
.Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
End Sub
Could you advise me on how to clean up the following code. I am trying to copy a set of range of cells from a sheet called ‘spool’ to sheet 1 but transpose the cells, so D1
Regards
Jupops
The code looks like:
Range("D1
Selection.Copy
Sheets("Sheet1"
Range("B2"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Range("F2"
Sheets("spool"
Range("E1:E4"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("F1:F4"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("J2"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("G1:G4"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("N2"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("D5
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("B3"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("E5:E8"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("F3"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("F5:F8"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("J3"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
Sheets("spool"
Range("G5:G8"
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1"
Range("N3"
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=True
End Sub