Re: Number variable loses format on write
- From: "Doug Glancy" <nobodyhere@xxxxxxxxxxxxxxxx>
- Date: Thu, 25 Aug 2005 12:32:49 -0700
Halray,
I think that if the cell your setting already has a format it might cause
what you're seeing, so try setting the format:
With ActiveWorkbook.Worksheets("Dump Area").Cells(RowNumber, 2)
.Value = AreaCounts
.NumberFormat = "#.0000"
End With
hth,
Doug
"Halray" <Halray@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D610F458-8031-4028-8F0A-36485707E623@xxxxxxxxxxxxxxxx
> Have have a varibale declared as a double, read a number into it from a
file.
> THe variable is indicated with four decimal places when viewed in the
> debugger. When I write the variable out to Excel using the following the
> number gets truncated to two decimal places:
>
> With ActiveWorkbook.Worksheets("Dump Area")
> .Cells(RowNumber, 2) = AreaCounts
>
> Anyone have any suggestions to fix this problem?
>
> Thanks !
>
>
>
> --
> Ray
.
- Follow-Ups:
- Re: Number variable loses format on write
- From: Halray
- Re: Number variable loses format on write
- References:
- Number variable loses format on write
- From: Halray
- Number variable loses format on write
- Prev by Date: RE: Construct Coluns via VBA
- Next by Date: Re: Keystrock in VB
- Previous by thread: Re: Number variable loses format on write
- Next by thread: Re: Number variable loses format on write
- Index(es):