Programmatically Protect/Unprotect Ranges in Excel 2003?

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

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
 
activesheet.Unprotect

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top