LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Number variable loses format on write

Halray wrote:
I had the varibale declared as: Dim AreaSum as double, so I'm confused as to
why one declaration works and the other doesn't. Do you think it has
anything to do with re-declarating (probably not the correct wording) the
variable and reassigning it the value just before writing it?


TypeName function returns the type of a variable.
check your variable like this:

Dim AreaCounts As Double
MsgBox TypeName(AreaCounts)

'your code

MsgBox TypeName(AreaCounts)
.Cells(RowNumber, 2) = AreaCounts

I wonder if you have overlooked a typo or a mistake like
"Dim AreaCounts, AreaSum As Double", and then the Variant variable
has a Currency value.

--
HTH,

okaizawa
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write 1234567890123456789 into a cell with number format Anila Excel Discussion (Misc queries) 3 February 13th 09 03:27 PM
number entered in cell loses trailing zeros in formula bar GKeyedr Excel Discussion (Misc queries) 5 January 10th 09 07:17 PM
variable number format in cell tina Excel Discussion (Misc queries) 2 November 7th 06 11:49 AM
webquery loses format of leading zero and to scientific Glen: Webquery format Excel Programming 3 August 11th 05 04:40 AM
Passing Number Format to a Variable ExcelMonkey[_133_] Excel Programming 13 June 7th 04 04:40 AM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"