Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ryan,
In a flash of programming inspiration, I noticed that some of my variables were declared as Single Precision. So quickly, I did a Ctrl+H and replaced all "Dim ... As Single" to "Dim ... As Double" thruout all my macros. I then commented out the On Error Resume Next and On Error GoTo 0 as shown below. I then ran this macro umpteen times and the overflow error no longer occurs. Ray!!! Dim NumShares As Double Dim NumSharesLong As Long ' On Error Resume Next NumShares = Round(aNumShrs(lRow, 1), 2) NumSharesLong = NumShares ' On Error GoTo 0 If aPrice(lRow, 1) - MaxPrice 0# Then MaxPrice = aPrice(lRow, 1) TotalPurchases = TotalPurchases + aPrice(lRow, 1) * aNumShrs(lRow, 1) TotalSharesPurchased = TotalSharesPurchased + NumSharesLong Sincerely, Michael |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Overflow Error | Excel Programming | |||
Overflow Error | Excel Programming | |||
Overflow error | Excel Programming | |||
Overflow Error | Excel Discussion (Misc queries) | |||
Help! Overflow Error 6 | Excel Programming |