activesheet.calculate
Posted by Farai on January 11, 2002 3:03 AM
Our class is trying to simulate a fruit machine, and we have a problem with activesheet.calculate. it seems that when a prize is allocated to a particular condition as shown below, the prize shows correctly but one 'chance' after it is suppossed to. the full code is below, hope you can help.
*****************************************************
Private Sub CommandButton1_Click()
Dim K, Totalwon, Bet As Integer
Totalwon = 0
prize = 999
If (Worksheets("Sheet1").Range("c8") = "Cherry") Then
prize = 10
End If
ActiveSheet.Calculate
Worksheets("Sheet1").Range("d12") = prize
Totalwon = Totalwon + prize
Bet = Bet + 1
Worksheets("sheet1").Range("C19") = Totalwon
Worksheets("sheet1").Range("C20") = Bet
End Sub
*****************************************************