Any idea why this piece of code would generate an error message:
ActiveWindow.SelectedSheets.Copy
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
ActiveSheet.PageSetup.RightFooter = "Extracted from Budget " & Now & Chr(12)
Module1.UnProtectIt
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Cells.Select
Selection.Locked = True
Selection.FormulaHidden = False
Module1.ProtectIt
Next ws
....i get an error on the 4th worksheet it tries to export at the "Selection.Locked = True" line. the message says Locked Range not defined.
Thanks
ActiveWindow.SelectedSheets.Copy
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
ActiveSheet.PageSetup.RightFooter = "Extracted from Budget " & Now & Chr(12)
Module1.UnProtectIt
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Cells.Select
Selection.Locked = True
Selection.FormulaHidden = False
Module1.ProtectIt
Next ws
....i get an error on the 4th worksheet it tries to export at the "Selection.Locked = True" line. the message says Locked Range not defined.
Thanks