Check Number between a Range

  • Thread starter Thread starter Phil K
  • Start date Start date
P

Phil K

I'm trying to find out if it is possible to and if so how to have an
inputted value between two number (label2 *1.01 and labe2*.98) will be an
acceptable "correct" number? Using ppt 2003


Private Sub CommandButton2_Click()
'Answer
Label2.Caption = Format((8.34 * Flow * (TS / 100) * (VS / 100)), "###")
Label6.Caption = "Lbs/Day"

----> Example If TextBox1 < Label2 * 1.01 Then

---> example 'if textbox1 > label2 * 0.98 Then

MsgBox ("Correct")

Else
MsgBox ("Wrong .. Click on Solution Button to help in how")
End If

End Sub
 
Thank you very much.

John Wilson said:
Maybe something like this?

Dim dUpperlimit As Double
Dim dLowerlimit As Double
dUpperlimit = label2 * 1.01
dLowerlimit = label2 * 0.98
Select Case inputnum
Case dLowerlimit To dUpperlimit
MsgBox "Correct"
Case Else
MsgBox "No ..."
End Select
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
 
Back
Top