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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROTECTING WORKSHEET

Status
Not open for further replies.

jatolo

MIS
Jul 17, 2006
40
US
Hi guys!!!!


Is there any way for EXCEL to ask "Do you want to protect this worksheet" before I close it.
I Must protect every worksheet, I keep forguering....
Thanks
 
Hi, of course. You would need a macro for that though. Do you want to be prompted when you close the file? What password do you want? Do you want to be prompted for that or should it already be known, or "hard-coded"? Will each sheet have it's own password?

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a Microsoft MVP? Professional Office Developers Association
- Leonardo da Vinci
 
Yes, it's simple ...

Code:
workbooks("Book1.xls").sheets("Sheet1").protect password:="passwordhere"

.. will protect one sheet. But I still don't think that covers the OP's solution, hence the questions.

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
I would have a bit of code tied to the close event run through each sheet's protection status and then prompt for a password to save with if it finds it unprotected.

Or if it's the same password or you don't actually need one then just have the code run through and do it automatically.

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Hi, guys thanks for the answer...and I think it's time to go deeper...
Any body knows A GOOD BOOK TO LEARN MACROS ????...
Sorry, I really want to learn EXCEL....
Thanks again............
 
Not sure what you mean by going deeper. Does that mean we need to do more fore a solution here? Let us know what you want to do and we can do it for you.

Learning Excel and learning Macros (VBA) are two very different and very difficult roads. I'd recommend first, keep on the free forums, you can learn absolutely everything you need right here (and other forums). Secondly, don't be afraid to ask the stupid questions (their not really stupid, but they feel that way sometimes). Thirdly, read a lot, post a little. Check out these books:


Almost any John Walkenbach or Bill Jelen book is good. Hope this helps. :)

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Zack...
Thanks for your Advice...
"It's time to go good deeper" means I must study, read, and prepare more....
Thanks again
JT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top