View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Popup box appears based on cell value entered

This modifies Carim's code a little to allow the password to be entered.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim val As Double
With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Range("E20:L20")) Is Nothing Then Exit Sub
If .Value < 1 Then
val = .Value
MsgBox "You are not allowed to enter " & val & " without
Manager's Approval"

RETRY:
MgrApprv = InputBox("Enter Password", "MANAGER APPROVAL")
If MgrApprv < "Password" Then
.Value = 1
GoTo RETRY:
End If
End If
End With
End Sub

A word of caution. If you make the value of the target equal blank [""]
then it sets up a perpetual loop for the msgbox and inputbox. That is why
the value is set to 1 if the wron password is used. If you get into the
loop, use Ctrl + Break to get out.

"bruner" wrote:

I have a population of users that can place a rate of 1.0 or greater in the
range E20:L20, if they want to enter less than 1.0 in this range, i want
there to be a popup box for a manager password to accept this rate below 1.0.
Anytime something below 1.0 is entered into these cells, this popup box
should appear and require the password.

Any suggestions on how to accomplish this?