ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Best Way to protect sheet & workbook with VB (https://www.excelbanter.com/excel-programming/304910-best-way-protect-sheet-workbook-vbulletin.html)

CDotWin

Best Way to protect sheet & workbook with VB
 
Help Please

I have certain cells locked and unlocked, and the locked cells cannot be selected when the sheet is protected. What is the best way to protect the sheet, but allow VB to run its code and place values into those cells that are locked? I tried .Unprotect and .Protect before and after each event, but it didnt prove to be very efficient and produced alot of errors.

Thanks in advance,
€” CDotWin

Tom Ogilvy

Best Way to protect sheet & workbook with VB
 
Look at the userinterfaceonly argument to the protect method.

--
Regards,
Tom Ogilvy

"CDotWin" wrote in message
...
Help Please

I have certain cells locked and unlocked, and the locked cells cannot be

selected when the sheet is protected. What is the best way to protect the
sheet, but allow VB to run its code and place values into those cells that
are locked? I tried .Unprotect and .Protect before and after each event,
but it didnt prove to be very efficient and produced alot of errors.

Thanks in advance,
- CDotWin





All times are GMT +1. The time now is 01:02 PM.

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