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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number problem 1

Status
Not open for further replies.

airtabaki

Technical User
Aug 7, 2003
31
BE
Probably it's been written before in here but I don't seem to find any that has to do with my little problem.

I've written a macro that will make a sum of certain columns. Now when there is one value that is not a number the macro will crash. Is there an easy way to test of the data are all numbers?

I've thought of the solution Val(), but that I find a bit dangerous. In this way it can happen that you make a typing mistake and without knowing it it will be changed in a number, so you get wrong data.
 
Highlite the columns in question...


then from menu select... Data>Validation

set "Allow" to either whole number or decimal (your choice)

then "Data" as greater than or equal to zero



...this will stop users from fumbling keys when they enter data
 
thanks a lot ... I didn't thought that it was that easy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top