Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Messagebox: Alert user Worksheet is Unprotected

Hello;

I would appreciate help with this one:

I have a worksheet which is protected with a password. Some (select) users
have access to the password and can modify it and are instructed that after
modifying it, they should again protect it using the same password so that
it cannot be changed by other users.

Sometimes users forget to re-protect the sheet. What code would be required
to alert the user that the worksheet is unprotected & that he/she should
password protect it. This code should get activated when the user exits from
the worksheet & goes to another without protecting it.


TIA
Maria


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Messagebox: Alert user Worksheet is Unprotected

Use the workbook_beforeClose event

if worksheets("Sheet1").ProtectContents = False then
msgbox "Protect sheet"
cancel = true
End if

--
Regards,
Tom Ogilvy

Maria wrote in message
...
Hello;

I would appreciate help with this one:

I have a worksheet which is protected with a password. Some (select) users
have access to the password and can modify it and are instructed that

after
modifying it, they should again protect it using the same password so that
it cannot be changed by other users.

Sometimes users forget to re-protect the sheet. What code would be

required
to alert the user that the worksheet is unprotected & that he/she should
password protect it. This code should get activated when the user exits

from
the worksheet & goes to another without protecting it.


TIA
Maria




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Messagebox: Alert user Worksheet is Unprotected

Thanks a lot Tom for your prompt reply. It worked perfectly.

I also tried putting the code in the Worksheet Deactivate part & it worked
as soon as the user went away from Sheet 1. Do you see any problems using it
this way?

Thanks
M

--
Maria "Tom Ogilvy" wrote in message
...
Use the workbook_beforeClose event

if worksheets("Sheet1").ProtectContents = False then
msgbox "Protect sheet"
cancel = true
End if

--
Regards,
Tom Ogilvy

Maria wrote in message
...
Hello;

I would appreciate help with this one:

I have a worksheet which is protected with a password. Some (select)

users
have access to the password and can modify it and are instructed that

after
modifying it, they should again protect it using the same password so

that
it cannot be changed by other users.

Sometimes users forget to re-protect the sheet. What code would be

required
to alert the user that the worksheet is unprotected & that he/she should
password protect it. This code should get activated when the user exits

from
the worksheet & goes to another without protecting it.


TIA
Maria






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Messagebox: Alert user Worksheet is Unprotected

Maria, you could also put some code to protect the sheet when the user
clicked on another sheet like this

Private Sub Worksheet_Deactivate()
Sheets("Sheet1").Protect password:="123"
End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"Maria" wrote in message
...
Thanks a lot Tom for your prompt reply. It worked perfectly.

I also tried putting the code in the Worksheet Deactivate part & it worked
as soon as the user went away from Sheet 1. Do you see any problems using

it
this way?

Thanks
M

--
Maria "Tom Ogilvy" wrote in message
...
Use the workbook_beforeClose event

if worksheets("Sheet1").ProtectContents = False then
msgbox "Protect sheet"
cancel = true
End if

--
Regards,
Tom Ogilvy

Maria wrote in message
...
Hello;

I would appreciate help with this one:

I have a worksheet which is protected with a password. Some (select)

users
have access to the password and can modify it and are instructed that

after
modifying it, they should again protect it using the same password so

that
it cannot be changed by other users.

Sometimes users forget to re-protect the sheet. What code would be

required
to alert the user that the worksheet is unprotected & that he/she

should
password protect it. This code should get activated when the user

exits
from
the worksheet & goes to another without protecting it.


TIA
Maria








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Messagebox: Alert user Worksheet is Unprotected

No particular problem. You have to cover the possibility the user could
close the workbook with that sheet active - thus never triggering the
deactivate event.

--
Regards,
Tom Ogilvy

Maria wrote in message
...
Thanks a lot Tom for your prompt reply. It worked perfectly.

I also tried putting the code in the Worksheet Deactivate part & it worked
as soon as the user went away from Sheet 1. Do you see any problems using

it
this way?

Thanks
M

--
Maria "Tom Ogilvy" wrote in message
...
Use the workbook_beforeClose event

if worksheets("Sheet1").ProtectContents = False then
msgbox "Protect sheet"
cancel = true
End if

--
Regards,
Tom Ogilvy

Maria wrote in message
...
Hello;

I would appreciate help with this one:

I have a worksheet which is protected with a password. Some (select)

users
have access to the password and can modify it and are instructed that

after
modifying it, they should again protect it using the same password so

that
it cannot be changed by other users.

Sometimes users forget to re-protect the sheet. What code would be

required
to alert the user that the worksheet is unprotected & that he/she

should
password protect it. This code should get activated when the user

exits
from
the worksheet & goes to another without protecting it.


TIA
Maria








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to navigate through unprotected cells only in a worksheet VictorO New Users to Excel 2 October 24th 08 12:11 AM
audio alert when a shared workbook is saved by any user Bob W Excel Discussion (Misc queries) 4 September 10th 08 02:03 AM
Alert user that row has been modified by changing row color jubu Excel Worksheet Functions 2 June 30th 07 12:46 AM
How do I add an alert message upon a user closing the workbook? ehoskins Excel Discussion (Misc queries) 1 July 12th 06 10:48 PM
Data Entry Alert in User Form Kev Excel Discussion (Misc queries) 6 January 8th 05 03:01 PM


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"