Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Protect ALL cells If Q

I want to protect all cells in a workbook if the Contents of cell B1 7. My
thinking is that if the value of Cell B1 7 then the worksheet should not
be worked on, kind of a security feature

Is there any such code I should use?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Protect ALL cells If Q

How does B1 get to be 7. Manual entry? Formula? Macro?

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to protect all cells in a workbook if the Contents of cell B1 7.

My
thinking is that if the value of Cell B1 7 then the worksheet should not
be worked on, kind of a security feature

Is there any such code I should use?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Protect ALL cells If Q

Hi Tom

It will be a formula based on =(NOW())-A1, so if the user tries to work on
the form after 7 days, they wouldn't be allowed to. A1 will change based on
external data every week


"Tom Ogilvy" wrote in message
...
How does B1 get to be 7. Manual entry? Formula? Macro?

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to protect all cells in a workbook if the Contents of cell B1

7.
My
thinking is that if the value of Cell B1 7 then the worksheet should

not
be worked on, kind of a security feature

Is there any such code I should use?

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Protect ALL cells If Q

right click on the sheet tab and select view code.

Paste in code like this:

Private Sub Worksheet_Calculate()
If Range("B1").Value 7 Then
If ActiveSheet.ProtectContents = False Then
Me.Cells.Locked = True
Me.Protect
End If
End If
End Sub


--
Regards,
Tom Ogilvy

"John" wrote in message
...
Hi Tom

It will be a formula based on =(NOW())-A1, so if the user tries to work on
the form after 7 days, they wouldn't be allowed to. A1 will change based

on
external data every week


"Tom Ogilvy" wrote in message
...
How does B1 get to be 7. Manual entry? Formula? Macro?

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to protect all cells in a workbook if the Contents of cell B1

7.
My
thinking is that if the value of Cell B1 7 then the worksheet should

not
be worked on, kind of a security feature

Is there any such code I should use?

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Protect ALL cells If Q

Super Tom Thanks for that


"Tom Ogilvy" wrote in message
...
right click on the sheet tab and select view code.

Paste in code like this:

Private Sub Worksheet_Calculate()
If Range("B1").Value 7 Then
If ActiveSheet.ProtectContents = False Then
Me.Cells.Locked = True
Me.Protect
End If
End If
End Sub


--
Regards,
Tom Ogilvy

"John" wrote in message
...
Hi Tom

It will be a formula based on =(NOW())-A1, so if the user tries to work

on
the form after 7 days, they wouldn't be allowed to. A1 will change based

on
external data every week


"Tom Ogilvy" wrote in message
...
How does B1 get to be 7. Manual entry? Formula? Macro?

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to protect all cells in a workbook if the Contents of cell B1


7.
My
thinking is that if the value of Cell B1 7 then the worksheet

should
not
be worked on, kind of a security feature

Is there any such code I should use?

Thanks










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
protect cells in excel, but also allow a search in those cells? LindaAlex Excel Worksheet Functions 2 January 28th 10 02:51 PM
How do I protect cells or a range of cells in excel spreadsheet? Abundance Excel Worksheet Functions 1 July 28th 09 11:03 PM
Protect Only Certain Cells bgcooker Excel Discussion (Misc queries) 2 March 25th 09 03:38 PM
Protect Cells ??? Jcraig713 Excel Discussion (Misc queries) 2 January 27th 06 02:57 PM
about protect just cells tjtjjtjt Excel Discussion (Misc queries) 3 December 7th 04 01:35 PM


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