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

Whole number

Status
Not open for further replies.

MagicalDean

Technical User
Feb 16, 2005
61
GB
I'm sure this is really simple, but how do I get VBA to check if a number is a whole number? Its probably really simple but I can't see how to do it :( Any help is greatly apprechiated
 
If the number is the same as it's integer and greater than zero, isn't it a whole number ?

if MYNUMBER >= 0 and int(MYNUMBER) = MYNUMBER then msgbox "I AM WHOLE"
 
You don't even need the >=0 check - the rest of the statement is enough.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top