Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I want to validate data to m 1

Status
Not open for further replies.

wuwang

Programmer
May 16, 2001
48
US
Hi,

I want to validate data to make sure it is NOT either decimal or negative number.
I used "If Not IsNumeric(vData2) Then ....."
but it didn't work well.

Is there any other function I can use in EXCEL 97?


Thank you in advance
 
Hi,
Do you mean that you only want positive integers?

If so...

=IF(a=ABS(INT(a)),"YES","NO")

Hope this helps. :) Skip,
metzgsk@voughtaircraft.com
 
Another way....

Highlite the column(s) in question,
then
from the menu...Data>Validation>settings

choose allow whole number, then Greater than 0



.........built in tools, a wonderful thing!
 
ETID - that suggestion is perfect for <0
but how did you get validation to allow whole number??
I'm confused about that part.
 



The first drop down in the &quot;settings&quot; tab, Validation criteria...

under the heading &quot;Allow:&quot;....then select &quot;whole number&quot;

then it will ask you for a min and/or a max...set the min to 0
------------
FYI, I'm using Excel 2000
 
Oh, little slow here.

For some reason, I was thinking wuwang wanted to evaluate AFTER data entry, but not so.

Your idea will certainly work well!

 
Thank you a lot for your great idea.
I used the code
If InStr(1, vData2, &quot;.&quot;) <> 0 Or Abs(vData2) > vData2 Then
.................

and it works well.

Thank you again.
 
Well....
wuwang opted for a VBA solution, and since this is the Microsoft: Office Forum, we were all looking for a built-in SPREADSHEET solution.

O L X-) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top