Excel Macro Rounds Value of Cell

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top