Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Popup box appears based on cell value entered

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?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Popup box appears based on cell value entered

Hi,

The initial control step ( without the password )

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"
.Value = 1
End If
End With
End Sub

HTH
  #3   Report Post  
Posted to microsoft.public.excel.programming
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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Popup box appears based on cell value entered

Carim and JLGWhiz...thanks so much! Really fantastic suggestions.

I have one more question. If a manager is not available at the moment and
they need to continue to work in the document, is there a way I could add a
third button to the dialog box that says "Keep rate at 1.0"?

This would then allow them to exit the loop without a manager over-ride to
go below the 1.0.

Thoughts?

"JLGWhiz" wrote:

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Popup box appears based on cell value entered

j.k. i figured it out. all i needed to do was eliminate that last "Go to
Retry:" and just replaced it with another message box saying "Password
Incorrect: Value will be set to 1.0 until correct password provided.



"bruner" wrote:

Carim and JLGWhiz...thanks so much! Really fantastic suggestions.

I have one more question. If a manager is not available at the moment and
they need to continue to work in the document, is there a way I could add a
third button to the dialog box that says "Keep rate at 1.0"?

This would then allow them to exit the loop without a manager over-ride to
go below the 1.0.

Thoughts?

"JLGWhiz" wrote:

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?

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
Satisfying two variables entered via popup Colin Hayes Excel Discussion (Misc queries) 1 February 3rd 10 09:04 PM
adding text that appears after the entered data Cindy B Setting up and Configuration of Excel 2 May 5th 08 05:37 PM
If values are'nt entered in cell a popup window comes up?? pano Excel Worksheet Functions 5 February 14th 07 02:30 PM
How do I create a popup window based on a cell value? bumper338 Excel Discussion (Misc queries) 2 November 28th 06 03:05 PM
User enters data in popup box - its entered into desired cell ian123[_30_] Excel Programming 1 December 28th 03 03:16 PM


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

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"