LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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 Crashing [email protected] Excel Discussion (Misc queries) 1 December 10th 07 02:23 PM
Crashing of Excel FASB Excel Discussion (Misc queries) 1 June 5th 07 04:32 PM
Help--Excel keeps crashing [email protected] Excel Discussion (Misc queries) 1 September 7th 05 10:22 PM
Excel VBA crashing Martin Wheeler Excel Programming 4 February 15th 04 09:05 PM
excel keeps crashing kickyr Excel Programming 4 December 4th 03 09:58 PM


All times are GMT +1. The time now is 11:49 AM.

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"