Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default locking use of the file.

I would like to lock to file if the value of cell is outside its limit
value. Then the person using the file would have to call in and get help.


--
Francis X. Boudreaux

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default locking use of the file.

One way:

Assuming the limit is 0 < A1 < 100:


Private Sub Worksheet_Calculate()
Const PWORD As String = "drowssap"
Dim bValid As Boolean
With Range("A1")
If IsNumeric(.Value) Then _
If .Value 0 Then _
If .Value < 100 Then _
bValid = True
End With
If Not bValid Then
Me.Unprotect PWORD
Me.Cells.Locked = True
Me.Protect PWORD
MsgBox "A1 is out of range. Call home."
End If
End Sub

This can be modified if more than one sheet needs to be locked down.

However, be aware that worksheet protection is extremely weak. A
motivated user with enough skill to find this newsgroup can figure out
how to bypass it.



In article ,
"FX Boudreaux" wrote:

I would like to lock to file if the value of cell is outside its limit
value. Then the person using the file would have to call in and get help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default locking use of the file.

I need to run a Macro from a cell value if the cell value is greater
then 42. If the number is 43 and above, I need to lock close the sheet.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Locking a file MD Excel Discussion (Misc queries) 4 May 11th 10 02:40 PM
Excel file keeps locking - Strange problem Mick34 Excel Discussion (Misc queries) 0 July 15th 09 03:04 PM
row locking, instead of file locking? Bob W Excel Discussion (Misc queries) 2 September 7th 07 09:36 PM
Locking linked file location in a formula ScottL Excel Discussion (Misc queries) 0 July 9th 07 07:50 PM
excel 2007 file locking TMC Excel Discussion (Misc queries) 0 February 6th 07 04:08 PM


All times are GMT +1. The time now is 03:40 PM.

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"