Private Sub TossCoins_Click()

    Dim Outcomes(11) As Integer
    Dim NumHeads As Integer
    Dim NumTosses As Integer
    Dim j As Integer
    Set CurrentSheet = Application.ActiveSheet
 
    NumTosses = CInt(InputBox("Number of Tosses?", "Toss Coins"))
    For j = 0 To 10
        Outcomes(j) = 0
    Next j
    Randomize
    For j = 0 To NumTosses
        NumHeads = 0
        For k = 1 To 10
            NumHeads = NumHeads + Int(2 * Rnd)
        Next k
        Outcomes(NumHeads) = Outcomes(NumHeads) + 1
    Next j
 
    For k = 0 To 10
        CurrentSheet.Cells(k + 8, 2) = Outcomes(k)
    Next k
    CurrentSheet.Cells(5, 1) = NumTosses
 
End Sub