Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to keep excel from crashing?
Any ideas on how to keep excel from crashing while running the
following? Is asking it to do a for loop with 10 billion iterations simply too much? Thanks in advance, Keith Private Sub CommandButton1_Click() Dim StartPrice As Variant Dim SharesOut As Variant Dim NewPrice As Variant Dim Cash As Variant Dim ATIIPerShare As Variant Dim PriceApprec As Variant Dim SharePurch As Variant Dim MarketCap As Variant Dim Interest As Variant Dim Tax As Variant Cash = 56407000000# StartPrice = 27.64 SharesOut = 10770000724# MarketCap = 297876300000# Interest = 0.05 Tax = 0.33 For SharePurch = 1 To 10770000724# SharesOut = SharesOut - 1 NewPrice = MarketCap / SharesOut Cash = Cash - NewPrice ATIIPerShare = ((Cash * Interest) * (1 - Tax)) / SharesOut PriceApprec = NewPrice - StartPrice If ATIIPerShare = PriceApprec Then MsgBox ("Shares Repurchased = " & SharesPurch & " and New Cash Balance = " & Cash) Exit For End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Crashing | Excel Discussion (Misc queries) | |||
Crashing of Excel | Excel Discussion (Misc queries) | |||
Help--Excel keeps crashing | Excel Discussion (Misc queries) | |||
Excel VBA crashing | Excel Programming | |||
excel keeps crashing | Excel Programming |