LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA code outputs currency value rounded to 2 decimal points

Hello,

I have a macro which calculates the value of a currency variable and
then using the statement
ActiveCell.Offset(-1,7).Value = currTradeValue outputs it to a
spreadsheet.

The value is always rounded to 2 decimal points despite trying the
following;

1. I have checked the value of the variable prior to the above
statement being executed and it is as I expect - 3 decimal points e.g.
-1.125

2. Formatted the target cell using
ActiveCell.Offset(-1,7).NumberFormat = "#,##0.00_);[Red](#,##0.00)"
prior to the assignment statement.

3. Manually formatted the cell within Excel prior to the assignment
statement.

4. Checked the Online Help.

If I have a cell that contains a 4 decimal point number for example
and format the cell to round to 2 decimal points, and then select that
cell, the number in the formula bar is the original 4 decimal point
number.

For some reason, the value of the currency variable seems to be
modifed to 2 decimal points before being output as it is the modified
value that I see in the formula bar when the cell in question is
selected.

Could someone please tell me what I or Excel is doing wrong.

Thank you
Mark.

 
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
Decimal Points Jim Wyns[_2_] New Users to Excel 2 July 21st 08 03:41 PM
auto decimal in currency mike6342 Excel Worksheet Functions 1 October 24th 07 05:40 AM
How can I convert decimal commas to decimal points? Peteylepieu Excel Discussion (Misc queries) 1 October 2nd 07 10:18 PM
Decimal Points Leanne Excel Worksheet Functions 1 June 28th 05 02:30 AM
decimal places in currency David Adamson[_4_] Excel Programming 4 July 19th 04 12:26 AM


All times are GMT +1. The time now is 07:17 PM.

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

About Us

"It's about Microsoft Excel"