Hi I have the following macro that comes with compile error expected end with.
Looking online it says I should have END SUB but already got that. Any ideas?
Looking online it says I should have END SUB but already got that. Any ideas?
VBA Code:
Sub printshiftsheet()
'
' printshiftsheet Macro
'
Const cPassword As String = "ccc"
Dim oWs As Worksheet
Set oWs = ThisWorkbook.Worksheets("ShiftSheet")
With oWs
.Unprotect Password:=cPassword
Range("B10:D23").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
ActiveWorkbook.Save
.PageSetup.PrintArea = "$A$3:$H$53"
Range("B10:D23").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.PatternTintAndShade = 0
.Range("D8").Value = .Range("D8").Value + 1
Application.Dialogs(xlDialogPrint).Show
.Cells.Locked = True
.Cells.FormulaHidden = False
.Range("C5:D7,H11:H22,H36:H40,D34:D38,B46:H47,G56:H56,C60:C71,G77:H77,C81:C88,G93:H93,C94:C101").Locked = False
.Protect Password:=cPassword, DrawingObjects:=False, Contents:=True, Scenarios:=False
oWs.Parent.Save
End Sub