Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock and UnLock sheets without password? 1

Status
Not open for further replies.
Mar 26, 2004
19
0
0
GB
Hi, I have a small issue I want a spreadsheet to clear certain ranges when a button in pressed - how ever the sheet that needs clearing is password locked and when you run the macro it asks for the password.

I dont want the password box to open, is there a way around this apart from the obvioud not having the spreadsheet locked in the first place???????????


cheers
 
Take a look at the Unprotec and Protect methods.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Use the workbook OPEN event to set Sheets("Sheetname").protect userinterfaceonly:=true

This sets the sheet as protected but only from the user's point of view - code can run freely, as if the sheet was NOT protected - you have to set this property each time the workbook opens however as it is not saved

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top