Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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





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
Macro to select Range to protect and unprotect ranges [email protected] Excel Worksheet Functions 2 May 15th 09 06:04 AM
Problem using protect/Unprotect in excel 97 spyrule[_2_] Excel Programming 1 July 19th 06 09:59 PM
unprotect/protect grouped worksheets in excel mcwhirter Setting up and Configuration of Excel 1 August 8th 05 01:21 AM
Excel VBA-Protect and unprotect sheet with BVA marfrk Excel Programming 1 May 3rd 04 12:37 PM
Excel VBA - Problems using Protect/Unprotect a worksheet Gary Richie Excel Programming 2 February 6th 04 03:29 AM


All times are GMT +1. The time now is 06:51 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"