NORRILLOUS
New Member
- Joined
- Apr 10, 2014
- Messages
- 36
- Office Version
- 365
- Platform
- Windows
I have been trying to expand this macro to work on a larger range of worksheets and I am not sure how. The file is setup to cover shifts and each sheet is a day (imagine 93 tabs that represent 1 month and look like the same form over and over), I am trying to update the file where it is recorded in a single dataset but in order to preserve the old data I need to move it to the dataset. Hence why I wrote the below code.
Well This worked for those three sheets, So I thought to myself Record it as a Macro and see what you missing....
I pretty well came up with the same thing...just a lot more text.
VBA Code:
Sub CopyOldPasteNew()
'
Worksheets("1 - 3rd").Range("A6:A35").Copy
Worksheets("Press Transposed Data").Range("A1").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Worksheets("1 - 3rd").Range("c6:o35").Copy
Worksheets("Press Transposed Data").Range("A2").PasteSpecial Paste:=xlPasteValues, Transpose:=True
'Sealer Side
Worksheets("1 - 3rd").Range("A36:A64").Copy
Worksheets("Sealer Transposed Data").Range("A1").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Worksheets("1 - 3rd").Range("c36:o64").Copy
Worksheets("Sealer Transposed Data").Range("A2").PasteSpecial Paste:=xlPasteValues, Transpose:=True
End Sub
I pretty well came up with the same thing...just a lot more text.
VBA Code:
Sub Macro3()
'
' Macro3 Macro
'
'
Range("A20").Select
Sheets("1 - 3rd").Select
Range("A6:A35").Select
Selection.Copy
Sheets("Press Transposed Data").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("1 - 3rd").Select
Range("C6:O35").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Press Transposed Data").Select
Range("A21").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveWindow.SmallScroll Down:=3
Sheets("1 - 1st").Select
ActiveWindow.SmallScroll Down:=-6
Range("C6:O35").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Press Transposed Data").Select
Range("A34").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveWindow.SmallScroll Down:=12
Range("A47").Select
Sheets("1 - 2nd").Select
Range("C6:O35").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Press Transposed Data").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub