Hi ladies and gentleman, meet me again.
Now I want to show you about tutorial how make a simple Spin Machine Game or Slot Machine Game with VBA Excel.
I hope this can help you for expanding nice game with VBA Excel.
Ok, we now to begin to create it
Sub PLAY_Click()
Range("B4") = Int((7 * Rnd) + 1)
Range("F4") = Int((7 * Rnd) + 1)
Range("J4") = Int((7 * Rnd) + 1)
Range("J2").Value = Range("F1")
x = x + 1
Range("F1").Value = Range("F1").Value + x
y = Range("B4") & Range("F4") & Range("J4")
If y = "111" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.111"
End If
If y = "222" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.222"
End If
If y = "333" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.333"
End If
If y = "444" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.444"
End If
If y = "555" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.555"
End If
If y = "666" Then
Range("F1").Value = Range("F1") + y
MsgBox "BONUS Rp.666"
End If
If y = "777" Then
Range("F1").Value = 1000000 + y
MsgBox "LUCKY SEVEN ! YOU WINNER !!!" & vbNewLine & "YOUR WIN MONEY : Rp. 1.000.000"
End If
End Sub
Sub BANK()
Range("B15").Value = Range("B15") + Range("F1")
MsgBox "SAVE YOUR MONEY TO BANK, SUCCESS !"
x = 0
Range("F1").Value = x
Range("B4").Value = 0
Range("F4").Value = 0
Range("J2").Value = 0
Range("J4").Value = 0
End Sub
Sub start()
x = 0
Range("F1").Value = x
Range("B4").Value = 0
Range("F4").Value = 0
Range("J2").Value = 0
Range("J4").Value = 0
Range("B15").Value = 0
End Sub
So tutorial by me, don't forget your vote for me hopefully can be developed to be better and see you again :)