So I know there are numerous thread on this but for some reason I can't seem to get my macro to run on a protected sheet. I have tried the suggestions found via search of the forums but I keep getting a Error of '400'.
Below is my current code I believe should work
Below is my current code I believe should work
Code:
Sub PrintMarkedRows()
ActiveSheet.Unprotect Password:="password"
'Only Print Cells in A1:P122
ActiveSheet.AutoFilterMode = False
Range("$A$1:$P$122").AutoFilter
ActiveSheet.Range("$A$1:$P$122").AutoFilter Field:=16, Criteria1:="<>"
ActiveSheet.PageSetup.PrintArea = "$A$1:$O$122"
ActiveSheet.PrintOut
ActiveSheet.AutoFilterMode = False
ActiveSheet.Protect Password:="password"
End Sub