Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
Excel VBA Editor Help says Decimal is a supported data type, but
defining a variable as Decimal does not work. Dim decX as Decimal How can I do this? Is there a reference that I need to add? Thanks, Wes |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
Also from VBA Help:
Note At this time the Decimal data type can only be used within a Variant, that is, you cannot declare a variable to be of type Decimal. You can, however, create a Variant whose subtype is Decimal using the CDec function. -- Kind regards, Niek Otten Microsoft MVP - Excel "Sun Tzu" wrote in message ups.com... | Excel VBA Editor Help says Decimal is a supported data type, but | defining a variable as Decimal does not work. | | Dim decX as Decimal | | How can I do this? Is there a reference that I need to add? | | Thanks, | Wes | |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
I'd use:
Dim decX as variant decx = cdec(someothervariable) Sun Tzu wrote: Excel VBA Editor Help says Decimal is a supported data type, but defining a variable as Decimal does not work. Dim decX as Decimal How can I do this? Is there a reference that I need to add? Thanks, Wes -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
Hi,
Use 'Single' for 7 decimals of precision or 'Double' for 15 decimals of precision Mike. "Sun Tzu" wrote: Excel VBA Editor Help says Decimal is a supported data type, but defining a variable as Decimal does not work. Dim decX as Decimal How can I do this? Is there a reference that I need to add? Thanks, Wes |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
I see now.
Thanks much! Wes On Nov 7, 8:44 am, "Niek Otten" wrote: Also from VBA Help: Note At this time the Decimal data type can only be used within a Variant, that is, you cannot declare a variable to be of type Decimal. You can, however, create a Variant whose subtype is Decimal using the CDec function. -- Kind regards, Niek Otten Microsoft MVP - Excel "Sun Tzu" wrote in oglegroups.com... | Excel VBA Editor Help says Decimal is a supported data type, but | defining a variable as Decimal does not work. | | Dim decX as Decimal | | How can I do this? Is there a reference that I need to add? | | Thanks, | Wes | |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
Hi, Mike,
Unfortunately, not all decimal values convert accurately to binary formats. That's why Decimal format exists. Thanks, Wes On Nov 7, 8:51 am, Mike H wrote: Hi, Use 'Single' for 7 decimals of precision or 'Double' for 15 decimals of precision Mike. "Sun Tzu" wrote: Excel VBA Editor Help says Decimal is a supported data type, but defining a variable as Decimal does not work. Dim decX as Decimal How can I do this? Is there a reference that I need to add? Thanks, Wes- Hide quoted text - - Show quoted text - |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use Decimal data type?
Thanks, Dave!
Wes On Nov 7, 8:45 am, Dave Peterson wrote: I'd use: Dim decX as variant decx = cdec(someothervariable) Sun Tzu wrote: Excel VBA Editor Help says Decimal is a supported data type, but defining a variable as Decimal does not work. Dim decX as Decimal How can I do this? Is there a reference that I need to add? Thanks, Wes -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to type format time in decimal format & calculate time | Excel Discussion (Misc queries) | |||
How to type format time in decimal format & calculate | Excel Discussion (Misc queries) | |||
when I type numbers in a cell it changes it to a decimal point | Excel Discussion (Misc queries) | |||
ALL NUMBERS I TYPE HAVE DECIMAL POINT | Excel Discussion (Misc queries) | |||
Decimal type in Excel 97 | Excel Programming |