Sub SetPrintArea()
Sheet2.Unprotect Password:="2287"
'Sets Print Area and prints
ActiveWindow.SelectedSheets("Print Screen").Visible = xlSheetVisible
Sheets("Print Screen").Select
Selection.AutoFilter Field:=1, Criteria1:="<>", Operator:=xlAnd
Dim LstRw As Long
Dim ws As Worksheet
Set ws = Sheets("Print Screen")
With ws
LstRw = .Cells(Rows.Count, "A").End(xlUp).Row
End With
Columns("$A:$H").Select
With ActiveSheet.PageSetup
.FitToPagesWide = 1
ActiveSheet.PageSetup.PrintArea = "A1:H1" & LstRw
End With
Selection.PrintOut Copies:=1, Preview:=True, Collate:=True
MsgBox "See you again @"
Sheet2.Unprotect Password:="PASWORD"
ActiveWindow.SelectedSheets("Print Screen").Visible = xlSheetVisible
Sheets("Print Screen").Select
Selection.AutoFilter Field:=1
ActiveSheet.Protect Password:="PASWORD"
Sheet2.EnableAutoFilter = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
End Sub
HI Vog not working
When im press tools > protection > unprotect then ,all release with no need password .