Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default protecting the entire worksheet

I'm using Office 2007

Thru VBA-coding I'm protecting my worksheet so that the users
can only select and enter data into certain fields (those fields have
been unchecked for "Locked" in the Format Cells.../Protection).

At a certain event (pushbutton) I would like to have those unprotected
cells also being protected ("no more input allowed") until another "Reset"-
event/pushbutton opens up those cells again for input.

I didn't find any VBA-Help for such a coding...
Any proposal?

Harry


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default protecting the entire worksheet

Hi Harry

Unprotect the sheet, change the Locked property for the desired cells to
True and reprotect the sheet. To reset just change the Locked property to
False.

'Protect TargetCells
Sheets("Sheet1").Unprotect
Range("TargetCells").Locked = True
Sheets("Sheet1").Protect

Regards,
Per

"Hartmut (Harry) Kloppert" skrev i meddelelsen
...
I'm using Office 2007

Thru VBA-coding I'm protecting my worksheet so that the users
can only select and enter data into certain fields (those fields have
been unchecked for "Locked" in the Format Cells.../Protection).

At a certain event (pushbutton) I would like to have those unprotected
cells also being protected ("no more input allowed") until another
"Reset"-
event/pushbutton opens up those cells again for input.

I didn't find any VBA-Help for such a coding...
Any proposal?

Harry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default protecting the entire worksheet

Thank you Per, that works perfectly.
(I didn't find anything in the Help-file though)

Harry

"Per Jessen" wrote in message
...
Hi Harry

Unprotect the sheet, change the Locked property for the desired cells to
True and reprotect the sheet. To reset just change the Locked property to
False.

'Protect TargetCells
Sheets("Sheet1").Unprotect
Range("TargetCells").Locked = True
Sheets("Sheet1").Protect

Regards,
Per

"Hartmut (Harry) Kloppert" skrev i meddelelsen
...
I'm using Office 2007

Thru VBA-coding I'm protecting my worksheet so that the users
can only select and enter data into certain fields (those fields have
been unchecked for "Locked" in the Format Cells.../Protection).

At a certain event (pushbutton) I would like to have those unprotected
cells also being protected ("no more input allowed") until another
"Reset"-
event/pushbutton opens up those cells again for input.

I didn't find any VBA-Help for such a coding...
Any proposal?

Harry




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default protecting the entire worksheet

Hi Harry,

Thanks for your reply, I'm glad that you made it work

Per

"Hartmut (Harry) Kloppert" skrev i meddelelsen
...
Thank you Per, that works perfectly.
(I didn't find anything in the Help-file though)

Harry


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
Protecting worksheet Patricia Excel Discussion (Misc queries) 1 March 15th 10 02:49 PM
Protecting a worksheet Anthony Excel Programming 2 July 17th 08 08:26 PM
Protecting Entire Workbook from Deletion Missy43 Excel Discussion (Misc queries) 2 July 7th 07 12:14 PM
Protecting an entire workbook dumbass Excel Programming 1 May 25th 04 01:14 AM
Protecting worksheet Shilps Excel Programming 2 April 27th 04 01:01 PM


All times are GMT +1. The time now is 10:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"