#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default 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
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
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
For/Loop skipping one value in loop only Matt Jensen Excel Programming 6 January 8th 05 12:03 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 10:43 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"