Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Recognizing a whole number instead of a decimal

Please help. What VBA code could automate the recognition of a whole number
instead of a decimal? My pending programming will generate values that are
either whole numbers or decimals. I only want to recognize whole numbers.

Thank you very much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Recognizing a whole number instead of a decimal

Hi

A general test
if n = INT(n) then

Best wishes Harald

"horsepro001" skrev i melding
...
Please help. What VBA code could automate the recognition of a whole

number
instead of a decimal? My pending programming will generate values that are
either whole numbers or decimals. I only want to recognize whole numbers.

Thank you very much.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Recognizing a whole number instead of a decimal

Assuming the number is in variable myNum

If myNum = Int(myNum) Then
...

--

HTH

RP
(remove nothere from the email address if mailing direct)


"horsepro001" wrote in message
...
Please help. What VBA code could automate the recognition of a whole

number
instead of a decimal? My pending programming will generate values that are
either whole numbers or decimals. I only want to recognize whole numbers.

Thank you very much.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Recognizing a whole number instead of a decimal

Thank you!!!

"Harald Staff" wrote:

Hi

A general test
if n = INT(n) then

Best wishes Harald

"horsepro001" skrev i melding
...
Please help. What VBA code could automate the recognition of a whole

number
instead of a decimal? My pending programming will generate values that are
either whole numbers or decimals. I only want to recognize whole numbers.

Thank you very much.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Recognizing a whole number instead of a decimal

Thank you!!!

"Bob Phillips" wrote:

Assuming the number is in variable myNum

If myNum = Int(myNum) Then
...

--

HTH

RP
(remove nothere from the email address if mailing direct)


"horsepro001" wrote in message
...
Please help. What VBA code could automate the recognition of a whole

number
instead of a decimal? My pending programming will generate values that are
either whole numbers or decimals. I only want to recognize whole numbers.

Thank you very much.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to correct the decimal number to the nearest even number santosh kutre Excel Worksheet Functions 3 November 3rd 08 04:04 PM
Add decimal to number evoxfan Excel Discussion (Misc queries) 3 October 8th 08 05:33 PM
Converting 2-place decimal value to floating point decimal number with leading zero Kermit Piper Excel Discussion (Misc queries) 3 March 18th 06 06:20 PM
converting number string to number with decimal rortiz Excel Worksheet Functions 2 September 15th 05 08:34 PM
How to convert a decimal number to a non-decimal number? snickers22 Excel Worksheet Functions 4 January 13th 05 10:04 PM


All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"