ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   variant and currency decimals (https://www.excelbanter.com/excel-programming/330784-variant-currency-decimals.html)

Mary

variant and currency decimals
 
I am using a variant variable to store the values of calculated cells and
then transfer that value to another cell. The values can be text,
percentages, or currency.

I need the four decimal places of the currency values. In the debug window,
when the variant subtype is currency, the four decimal places are present.
When the variant gets transferred to the worksheet, the currency value gets
rounded down to only two decimal places. The cell formatting of the source
and destination cells is exactly the same (currency, four decimals).

Can anyone explain what is happening? I'm using Excel 2000.

Thanks.
Mary

Tom Ogilvy

variant and currency decimals
 
try using the value2 property instead of value.

v = activecell.Value2

--
Regards,
Tom Ogilvy


"Mary" wrote in message
...
I am using a variant variable to store the values of calculated cells and
then transfer that value to another cell. The values can be text,
percentages, or currency.

I need the four decimal places of the currency values. In the debug

window,
when the variant subtype is currency, the four decimal places are present.
When the variant gets transferred to the worksheet, the currency value

gets
rounded down to only two decimal places. The cell formatting of the source
and destination cells is exactly the same (currency, four decimals).

Can anyone explain what is happening? I'm using Excel 2000.

Thanks.
Mary




Mary

variant and currency decimals
 
Awesome! I didn't even know there was a value2 property. Now I can have all
the decimal places that I want.

Thanks, Tom.

Mary

"Tom Ogilvy" wrote:

try using the value2 property instead of value.

v = activecell.Value2

--
Regards,
Tom Ogilvy




All times are GMT +1. The time now is 11:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com