Leighg1809
New Member
- Joined
- Jan 26, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I wrote my macro and all the headings in columns B,G,L,Q,V,AA,AF,AK,AP,AU,AZ,BE,BU and BO, all cells 11-18 are gone but I haven’t done clear contents in my macro. Please see my macro below
Thanks!!
Thanks!!
VBA Code:
Sub Copy_Sheets()
'
' Copy_Sheets Macro
' Creates Blank Production Schedule, Shift report and ORA sheets
'
'
Sheets(Array("Production Schedule", "Shift Report", "ORA")).Select
Sheets("ORA").Activate
Sheets(Array("Production Schedule", "Shift Report", "ORA")).Copy After:=Sheets(Sheets.Count)
Range("A11:A21").Select
Selection.ClearContents
Range("F11:S21").Select
Selection.ClearContents
Sheets("Shift Report (2)").Select
Range("B4:B10").Select
Selection.ClearContents
Range("D4:D10").Select
Selection.ClearContents
Range("C5:C18").Select
Selection.ClearContents
Range("C19").Select
Selection.ClearContents
Range("C22:D25").Select
Selection.ClearContents
Range("G4:G10").Select
Selection.ClearContents
Range("I4:I10").Select
Selection.ClearContents
Range("H5:H18").Select
Selection.ClearContents
Range("H19").Select
Selection.ClearContents
Range("H22:I25").Select
Selection.ClearContents
Range("L4:L10").Select
Selection.ClearContents
Range("N4:N10").Select
Selection.ClearContents
Range("M5:M18").Select
Selection.ClearContents
Range("M19").Select
Selection.ClearContents
Range("M22:N25").Select
Selection.ClearContents
Range("Q4:Q10").Select
Selection.ClearContents
Range("S4:S10").Select
Selection.ClearContents
Range("R5:R18").Select
Selection.ClearContents
Range("R19").Select
Selection.ClearContents
Range("R22:S25").Select
Selection.ClearContents
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 19
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 22
ActiveWindow.ScrollColumn = 23
ActiveWindow.ScrollColumn = 24
ActiveWindow.ScrollColumn = 25
ActiveWindow.ScrollColumn = 24
ActiveWindow.ScrollColumn = 23
ActiveWindow.ScrollColumn = 22
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 19
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
Range("V4:V10").Select
Selection.ClearContents
Range("X4:X10").Select
Selection.ClearContents
Range("W5:W18").Select
Selection.ClearContents
Range("W20").Select
Selection.ClearContents
Range("W22:X25").Select
Selection.ClearContents
Range("AA4:AA10").Select
Selection.ClearContents
Range("AC4:AC10").Select
Selection.ClearContents
Range("AB5:AB18").Select
Selection.ClearContents
Range("AB20").Select
Selection.ClearContents
Range("AB22:AC25").Select
Selection.ClearContents
Range("AD20").Select
ActiveWindow.SmallScroll ToRight:=18
Range("AF4:AF10").Select
Selection.ClearContents
Range("AH4:AH10").Select
Selection.ClearContents
Range("AG5:AG18").Select
Selection.ClearContents
Range("AG20").Select
Selection.ClearContents
Range("AG22:AH25").Select
Selection.ClearContents
Range("AK4:AK10").Select
Selection.ClearContents
Range("AM4:AM10").Select
Selection.ClearContents
Range("AL5:AL18").Select
Selection.ClearContents
Range("AL20").Select
Selection.ClearContents
Range("AL22:AM25").Select
Selection.ClearContents
Range("AP4:AP10").Select
Selection.ClearContents
Range("AR4:AR10").Select
Selection.ClearContents
Range("AQ5:AQ18").Select
Selection.ClearContents
Range("AQ20").Select
Selection.ClearContents
Range("AQ22:AR25").Select
Selection.ClearContents
Range("AU4:AU10").Select
Selection.ClearContents
Range("AW4:AW10").Select
Selection.ClearContents
Range("AV5:AV18").Select
Selection.ClearContents
Range("AV20").Select
Selection.ClearContents
Range("AV22:AW25").Select
Selection.ClearContents
ActiveWindow.SmallScroll ToRight:=19
Range("AZ4:AZ10").Select
Selection.ClearContents
Range("BB4:BB10").Select
Selection.ClearContents
Range("BA5:BA18").Select
Selection.ClearContents
Range("BA20").Select
Selection.ClearContents
Range("BA22:BB25").Select
Selection.ClearContents
Range("BE4:BE10").Select
Selection.ClearContents
Range("BG4:BG10").Select
Selection.ClearContents
Range("BF5:BF18").Select
Selection.ClearContents
Range("BF20").Select
Selection.ClearContents
Range("BF22:BG25").Select
Selection.ClearContents
Range("BJ4:BJ10").Select
Selection.ClearContents
Range("BL4:BL10").Select
Selection.ClearContents
Range("BK5:BK18").Select
Selection.ClearContents
Range("BK20").Select
Selection.ClearContents
Range("BK22:BL25").Select
Selection.ClearContents
ActiveWindow.SmallScroll ToRight:=7
Range("BO4:BO10").Select
Selection.ClearContents
Range("BQ4:BQ10").Select
Selection.ClearContents
Range("BP5:BP18").Select
Selection.ClearContents
Range("BP20").Select
Selection.ClearContents
Range("BP22:BQ25").Select
Selection.ClearContents
ActiveWindow.ScrollColumn = 55
ActiveWindow.ScrollColumn = 54
ActiveWindow.ScrollColumn = 52
ActiveWindow.ScrollColumn = 50
ActiveWindow.ScrollColumn = 49
ActiveWindow.ScrollColumn = 47
ActiveWindow.ScrollColumn = 45
ActiveWindow.ScrollColumn = 41
ActiveWindow.ScrollColumn = 39
ActiveWindow.ScrollColumn = 34
ActiveWindow.ScrollColumn = 30
ActiveWindow.ScrollColumn = 26
ActiveWindow.ScrollColumn = 22
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("ORA (2)").Select
Range("B1").Select
Sheets("Production Schedule (2)").Select
Range("A1").Select
End Sub
Last edited by a moderator: