locking use of the file.

F

FX Boudreaux

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.
 
J

JE McGimpsey

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.
 
F

Francis Boudreaux

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!
 
Top