PC Review


Reply
Thread Tools Rate Thread

Excel Macro Rounds Value of Cell

 
 
Greg
Guest
Posts: n/a
 
      9th Nov 2005
I have written a small and simple macro to take values from a
spreadsheet and email them. When I run the macro against the
spreasheet everything works fine unless there is a value in the cell
that is not a whole number. i.e. 4.5 When the macro collects the value
it rounds it down to a 4 instead of holding the value of 4.5. Can
anyone tell me why it does this and how I can stop it?

 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      10th Nov 2005
Hi Greg,

How have you dimmed the variable that holds the value?

If you have dimmed the variable as long or integer, the results you describe
would occur.

If this is the case, change the variable to double.

Otherwise, post the problematic code.

Incidentally, this would appear an Excel problem rather than an Outlook
problem and might, therefore, have been more effective had you posted it in
(say) the Excel.Programming NG.


---
Regards,
Norman



"Greg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have written a small and simple macro to take values from a
> spreadsheet and email them. When I run the macro against the
> spreasheet everything works fine unless there is a value in the cell
> that is not a whole number. i.e. 4.5 When the macro collects the value
> it rounds it down to a 4 instead of holding the value of 4.5. Can
> anyone tell me why it does this and how I can stop it?
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Macro that Rounds JR2010 Webmaster / Programming 0 1st Mar 2011 12:44 AM
Excel 2002 always rounds up automatically Kent Microsoft Excel Worksheet Functions 2 29th Jan 2010 06:23 AM
Excel 2003: Cell rounds 16 digit numbers- How to advoid rounding? Max T. Microsoft Excel Misc 1 20th Jan 2010 06:40 PM
How can set how a number rounds up in excel =?Utf-8?B?ZXJpYyBw?= Microsoft Excel Worksheet Functions 1 28th Oct 2004 03:59 AM
How can set how a number rounds up in excel =?Utf-8?B?RWxwYmRjYg==?= Microsoft Excel Worksheet Functions 1 26th Oct 2004 02:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 PM.