When im using macro protection sheets with password , but when im press on tool > protection > then unprotect but no need password then will unprotect .???
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 .
becouse the point is the password is using macro to protect ,but when im normal go to tools > protection > unprotect ,,then will release the protect no need to key password
on thaT U sent me test 1 u will know what im saying //with
Sheet2.EnableAutoFilter = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
and without this different tools > protect > unprotect
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.