ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I get excell to indicate when a number is out of a set ran. (https://www.excelbanter.com/excel-worksheet-functions/16654-how-do-i-get-excell-indicate-when-number-out-set-ran.html)

Jeff Harmon

How do I get excell to indicate when a number is out of a set ran.
 
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?

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

"Jeff Harmon" <Jeff wrote in message
...
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?




LanceB

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

Lanceb

"Jeff Harmon" wrote:

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?


Peo Sjoblom

Look at datavalidation allowwhole number

--

Regards,

Peo Sjoblom


"Jeff Harmon" <Jeff wrote in message
...
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?





All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com