Re: $$Excel-Macros$$ Single Data Type Number Length Growing

2010-04-07 Thread ashish koul
try for Range("a1").NumberFormat = "0.000" On Wed, Apr 7, 2010 at 11:26 PM, ashish koul 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, m

Re: $$Excel-Macros$$ Single Data Type Number Length Growing

2010-04-07 Thread ashish koul
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 wrote: > I'm working with variables that hold three decimal point numbers such > as .001 and 3.185. Excel VBA seems to ad

$$Excel-Macros$$ Single Data Type Number Length Growing

2010-04-07 Thread mike
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.0040018998981 for example. I've tried adding lots of rounding statements everytime I work with the variable