ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically Protect/Unprotect Ranges in Excel 2003? (https://www.excelbanter.com/excel-programming/389968-programmatically-protect-unprotect-ranges-excel-2003-a.html)

Tony

Programmatically Protect/Unprotect Ranges in Excel 2003?
 
Hi All,

I've got a spreadsheet with a few checkboxes. If a user checks one, I want
them to be able to edit specific cells. If they uncheck it, I want the
values they've entered zeroed out and the cells to be protected.

I can accomplish the second piece by unprotecting the sheet, zeroing the
values entered, then reprotecting the sheet. However, I haven't found out
how to unprotect a range so that the user can make entries after they've
checked the box.

Does anyone know if this can be done and if so, any pointers or sites with
samples you can point me to?

Thanks & Ciao,

Tony



Tom Ogilvy

Programmatically Protect/Unprotect Ranges in Excel 2003?
 
activesheet.Unprotect

range("B9:F10").Locked = False
Activesheet.Protect

--
Regards,
Tom Ogilvy


"Tony" wrote:

Hi All,

I've got a spreadsheet with a few checkboxes. If a user checks one, I want
them to be able to edit specific cells. If they uncheck it, I want the
values they've entered zeroed out and the cells to be protected.

I can accomplish the second piece by unprotecting the sheet, zeroing the
values entered, then reprotecting the sheet. However, I haven't found out
how to unprotect a range so that the user can make entries after they've
checked the box.

Does anyone know if this can be done and if so, any pointers or sites with
samples you can point me to?

Thanks & Ciao,

Tony




Tony

Programmatically Protect/Unprotect Ranges in Excel 2003?
 
Tom,

Worked like a charm. I appreciate the assistance.

Tony

"Tom Ogilvy" wrote in message
...
activesheet.Unprotect

range("B9:F10").Locked = False
Activesheet.Protect

--
Regards,
Tom Ogilvy


"Tony" wrote:

Hi All,

I've got a spreadsheet with a few checkboxes. If a user checks one, I
want
them to be able to edit specific cells. If they uncheck it, I want the
values they've entered zeroed out and the cells to be protected.

I can accomplish the second piece by unprotecting the sheet, zeroing the
values entered, then reprotecting the sheet. However, I haven't found
out
how to unprotect a range so that the user can make entries after they've
checked the box.

Does anyone know if this can be done and if so, any pointers or sites
with
samples you can point me to?

Thanks & Ciao,

Tony







All times are GMT +1. The time now is 06:49 AM.

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