Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Excel 2002 and VB declaring number as double

I have a program in VB in excel that parses a text file and loads the numbers
into the spread sheet. The problems is the numbers have gotten bigger, and
are now over 2.2 billion.
Dim Qty as long
I had the declaration above and then changed it to
Dim Qty as double
but it did not change the dim it still crashes if number is 2.17 billion or
higher

gary
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Excel 2002 and VB declaring number as double

Hi,

Double will handle number far larger than 2.17 billion. When is excel
crashing (what are the steps and which one brings Excel down?). Is this an
Excel VBA program or are you doing this externally. If in Excel, what is
your code? Are the numbers over 2.17 billion stored in the other program as
number, text or what?

floating-point numbers ranging in value from -1.79769313486231E308 to
-4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to
1.79769313486232E308 for positive values
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Gary" wrote:

I have a program in VB in excel that parses a text file and loads the numbers
into the spread sheet. The problems is the numbers have gotten bigger, and
are now over 2.2 billion.
Dim Qty as long
I had the declaration above and then changed it to
Dim Qty as double
but it did not change the dim it still crashes if number is 2.17 billion or
higher

gary

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Excel 2002 and VB declaring number as double

RdStr = Trim(Left(RdStr, X))
X = InStr(1, RdStr, " ")
Worksheets("Production").Cells(33, 5) = RdStr "used
to see where crashes
Qty = CLng(Left(RdStr, X - 1)) 'Crashes here
TechName = Right(RdStr, (Len(RdStr) - X))

Worksheets("Data").Cells(ct2, DataC) = TechName
Worksheets("Data").Cells(ct2, DataC + 1) = Qty

It crashes with error code 6 overload
this is what is in the string

2,780,257,000 Raw Resources


"Shane Devenshire" wrote:

Hi,

Double will handle number far larger than 2.17 billion. When is excel
crashing (what are the steps and which one brings Excel down?). Is this an
Excel VBA program or are you doing this externally. If in Excel, what is
your code? Are the numbers over 2.17 billion stored in the other program as
number, text or what?

floating-point numbers ranging in value from -1.79769313486231E308 to
-4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to
1.79769313486232E308 for positive values
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Gary" wrote:

I have a program in VB in excel that parses a text file and loads the numbers
into the spread sheet. The problems is the numbers have gotten bigger, and
are now over 2.2 billion.
Dim Qty as long
I had the declaration above and then changed it to
Dim Qty as double
but it did not change the dim it still crashes if number is 2.17 billion or
higher

gary

Reply
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
Excel 2002: How to find 0.00 in a column of number? Mr. Low Excel Discussion (Misc queries) 4 October 26th 08 12:19 AM
Excel 2002: How to convert number to text ? Mr. Low Excel Discussion (Misc queries) 7 February 29th 08 08:27 PM
Excel 2002 : How to deduct the first and last number ? Mr. Low Excel Discussion (Misc queries) 4 January 8th 07 03:47 PM
Declaring variables freekrill Excel Discussion (Misc queries) 2 July 19th 06 06:36 AM
Declaring variables freekrill Excel Discussion (Misc queries) 0 July 18th 06 06:15 PM


All times are GMT +1. The time now is 01:30 PM.

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

About Us

"It's about Microsoft Excel"