Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
while loop?
I have written the following code:
Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Dim x As Integer If Sheets("Summary").Range("K26") 24 Then MsgBox "YOU HAVE EXCEEDED 24 TON LIMIT" x = Application.InputBox( _ prompt:="At what tonnage would you like to be warned again?", Type:=2) End If If Sheets("Summary").Range("K26") x Then MsgBox "YOU HAVE EXCEEDED " & x & "TON LIMIT" End If End Sub Basically, if cell K26 exceeds 24 tons, i wan tthe user to be prompt ONCE. then asked for input on when he should be prompt again. I want the second warning to come up, and give the user the option to ignore warning or be reminded each time the tonnage is increased. any ideas?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
while loop?
Hi steve,
This may be a silly question, but... Why not overwrite the worksheet range with your new limit? ie place the limit value in some convenient cell (like A1 = 24) and Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Dim x As Single x = Sheets("Summary").Range("A1").Value If Sheets("Summary").Range("K26") x Then MsgBox "YOU HAVE EXCEEDED " & x & " TON LIMIT" x = Application.InputBox( _ prompt:="At what tonnage would you like to be warned again?", Type:=2) If x < 0 Then Sheets("Summary").Range("A1") = x End If End If End Sub Ed Ferrero http://www.edferrero.com I have written the following code: Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Dim x As Integer If Sheets("Summary").Range("K26") 24 Then MsgBox "YOU HAVE EXCEEDED 24 TON LIMIT" x = Application.InputBox( _ prompt:="At what tonnage would you like to be warned again?", Type:=2) End If If Sheets("Summary").Range("K26") x Then MsgBox "YOU HAVE EXCEEDED " & x & "TON LIMIT" End If End Sub Basically, if cell K26 exceeds 24 tons, i wan tthe user to be prompt ONCE. then asked for input on when he should be prompt again. I want the second warning to come up, and give the user the option to ignore warning or be reminded each time the tonnage is increased. any ideas?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
For/Loop skipping one value in loop only | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |