ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom dialog box on protected sheet (https://www.excelbanter.com/excel-programming/281509-custom-dialog-box-protected-sheet.html)

Paul Martin

Custom dialog box on protected sheet
 
Hi All

- I have a protected sheet.
- If a user attempts to type into a locked cell, I would like a custom dialog
box to appear, rather than the default ("the cell or chart you are trying to
change is protected and therefore read-only.....")
- I have successfully implemented this using the Worksheet_BeforeDoubleClick
or Workbook_SheetBeforeDoubleClick event, but can't work out how to achieve
this when the user attempts to type directly into a cell.

Any suggestions appreciated.

Thanks in advance.

Paul Martin
Melbourne, Australia

Dick Kusleika[_3_]

Custom dialog box on protected sheet
 
Paul

I don't know how to change the protection message, I don't think you can.
One kludgy work around is to use Data Validation for protection. If you
want to "lock" cell A1, you could put data validation in that cell that is

Custom - =Len(A1)=0

Then use the error alert tab on the validation dialog to create your own
message. You would have to remove the validation if you ever wanted to
change the cell. Also, you have to set up validation for every cell that
you want "locked", so a macro may be in order there.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Paul Martin" wrote in message
om...
Hi All

- I have a protected sheet.
- If a user attempts to type into a locked cell, I would like a custom

dialog
box to appear, rather than the default ("the cell or chart you are

trying to
change is protected and therefore read-only.....")
- I have successfully implemented this using the

Worksheet_BeforeDoubleClick
or Workbook_SheetBeforeDoubleClick event, but can't work out how to

achieve
this when the user attempts to type directly into a cell.

Any suggestions appreciated.

Thanks in advance.

Paul Martin
Melbourne, Australia




Paul Martin

Custom dialog box on protected sheet
 
Dick

That's not quite the solution I'm looking for, though I can improvise to
make it at least a partial fix. Thanks for your idea, and if anyone has
another solution, that'd be great.

Regards

Paul Martin
Melbourne, Australia

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 10:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com