try for

 Range("a1").NumberFormat = "0.000"

On Wed, Apr 7, 2010 at 11:26 PM, ashish koul <koul.ash...@gmail.com> wrote:

> try using this
>
>
>
> Format( result , "#,##0.000")
>
> example
> Sub a()
>
> Dim i As Integer
> i = 3.000567
> MsgBox Format(i, "#,##0.000")
> End Sub
>
>
>
>
> On Wed, Apr 7, 2010 at 10:15 PM, mike <mikesal...@gmail.com> wrote:
>
>> I'm working with variables that hold three decimal point numbers such
>> as .001 and 3.185.  Excel VBA seems to add extra digits to these
>> variables so that instead of -0.004 the value is -0.00400000018998981
>> for example.
>>
>> I've tried adding lots of rounding statements everytime I work with
>> the variables where I round to three decimals places.  The code is
>> becoming ugly looking adding these rounding statements.  Is there
>> another way to control the digits after decimal?
>>
>> --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our Facebook Group @
>> http://www.facebook.com/group.php?gid=287779555678
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> HELP US GROW !!
>>
>> We reach over 6,800 subscribers worldwide and receive many nice notes
>> about the learning and support from the group.Let friends and co-workers
>> know they can subscribe to group at
>> http://groups.google.com/group/excel-macros/subscribe
>>
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,800 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to