Hi everyone,
I have come across a video online on how to make a bingo generator with a histogram
so you get no repeats and a list of the previous numbers drawn.
In Cells A1-A75 you have the numbers 1-75
In Cells B1-B75 you also have the numbers 1-75
In Cells C1 you have =if(B1="","",RAND()) (copy down to C75)
In Cells D1 you have =if(B1="","",IF(Rank(C1,$C$1:$C$75)>1,"",Row(B1))) (copy down to D75)
In Cell E1 you have =small(D1:D75,1)
In Cells J1-N1 you have the Letters B I N G O
In Cells J2-N16 you have a criss cross box (so each individual cell is in its own box)
this will be the histogram box which tracks the previous numbers drawn.
In Cells J2 you have =IF(B1="",A1,"") Drag Down to J16
In Cells K2 you have =IF(B16="",A16,"") Drag Down to K16
In Cells L2 you have =IF(B31="",A31,"") Drag Down to L16
In cells M2 you have =IF(B46="",A46,"") Drag Down to M16
In cells N2 you have =IF(B61="",A61,"") Drag Down to N16
Ok this is as far as I have got, were it gets beyond me is the following:
In Cells G2-H4 there is a button named Draw ( I do not know how to create buttons)
In Cells G12-H13 there is a button named Reset Game ( again I don't know how to create and install buttons)
In Cells G5-H6 is where the current drawn number is displayed
There is some code used in Visual Basic which looks like this:
Private Sub btnDraw_Click()
Dim linenumber As Interger, numpick As Interger
Dim bingonum As String
linenumber = Range ("E1").Value
numpick = Range("B" & linenumber).Value
Range ("B" & linenumber).ClearContents
If numpick > 60 Then
bingonum = "O " & numpick
ElseIf numpick > 45 Then
bingonum ="G" & numpick
ElseIf numpick > 30 Then
bingonum = "N" & numpick
ElseIf numpick > 15 Then
bingonum = "I" & numpick
Else
bingonum ="B" & numpick
End If
Range ("G5").Value = bingonum
End Sub
Private Sub btnReset_Click()
Dim linenumber As Interger
linenumber = 1
Do
Range("B" & linenumber).Value = Range("A" & linenumber).Value
linenumber = linenumber + 1
Loop Until Range ("A" & linenumber).Value
Range("G5:H6").ClearContents
End Sub
Can somebody please explain how I create the buttons needed for this and what I have to do to get the current number displayed, do I just copy this code into a
Visual Basics and thats it to make it work??
I hope you have all followed along ok...
I have come across a video online on how to make a bingo generator with a histogram
so you get no repeats and a list of the previous numbers drawn.
In Cells A1-A75 you have the numbers 1-75
In Cells B1-B75 you also have the numbers 1-75
In Cells C1 you have =if(B1="","",RAND()) (copy down to C75)
In Cells D1 you have =if(B1="","",IF(Rank(C1,$C$1:$C$75)>1,"",Row(B1))) (copy down to D75)
In Cell E1 you have =small(D1:D75,1)
In Cells J1-N1 you have the Letters B I N G O
In Cells J2-N16 you have a criss cross box (so each individual cell is in its own box)
this will be the histogram box which tracks the previous numbers drawn.
In Cells J2 you have =IF(B1="",A1,"") Drag Down to J16
In Cells K2 you have =IF(B16="",A16,"") Drag Down to K16
In Cells L2 you have =IF(B31="",A31,"") Drag Down to L16
In cells M2 you have =IF(B46="",A46,"") Drag Down to M16
In cells N2 you have =IF(B61="",A61,"") Drag Down to N16
Ok this is as far as I have got, were it gets beyond me is the following:
In Cells G2-H4 there is a button named Draw ( I do not know how to create buttons)
In Cells G12-H13 there is a button named Reset Game ( again I don't know how to create and install buttons)
In Cells G5-H6 is where the current drawn number is displayed
There is some code used in Visual Basic which looks like this:
Private Sub btnDraw_Click()
Dim linenumber As Interger, numpick As Interger
Dim bingonum As String
linenumber = Range ("E1").Value
numpick = Range("B" & linenumber).Value
Range ("B" & linenumber).ClearContents
If numpick > 60 Then
bingonum = "O " & numpick
ElseIf numpick > 45 Then
bingonum ="G" & numpick
ElseIf numpick > 30 Then
bingonum = "N" & numpick
ElseIf numpick > 15 Then
bingonum = "I" & numpick
Else
bingonum ="B" & numpick
End If
Range ("G5").Value = bingonum
End Sub
Private Sub btnReset_Click()
Dim linenumber As Interger
linenumber = 1
Do
Range("B" & linenumber).Value = Range("A" & linenumber).Value
linenumber = linenumber + 1
Loop Until Range ("A" & linenumber).Value
Range("G5:H6").ClearContents
End Sub
Can somebody please explain how I create the buttons needed for this and what I have to do to get the current number displayed, do I just copy this code into a
Visual Basics and thats it to make it work??
I hope you have all followed along ok...