How do I get excell to indicate when a number is out of a set ran.

J

Jeff Harmon

I am trying to set up a spreadsheet which will indicate when the numbers
plugged into the text boxes are outside of a set range. For example, the
range for a certain set of numbers needs to be 5-30, and the number which I
enter in is 33, is there a way to set up the spreadsheet to indicate that the
number is not in that 5-30 range without my having to go back through and
physically check?
 
J

JulieD

Hi Jeff

plugged in the "text boxes" ... do you mean cells, if so, you can use Data /
Validation to stop incorrect entry, or "post validate" the cells and circle
invalid data using tools / formula auditing / auditing toolbar - circle
invalid data

if you mean actual text boxes from the control toolbox toolbar you can use
code against the textbox1_lostfocus event to check the entry. - right mouse
click on the textbox, choose view code to enter the code, e.g

Private Sub TextBox1_LostFocus()
If TextBox1.Value > 30 Or TextBox1.Value < 5 Then MsgBox "wrong"
End Sub

Hope this helps
Cheers
JulieD
 
L

LanceB

You cound use data|validation, select custom and add the formula
=AND(A1>4,A1<31)

Lanceb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top