below this code work till TextBox6.value = 9 and than crash i need it work TextBox6.value = 10 and then show message box
i upload sample file
Private Sub CommandButton1_Click()
If Sheets("ENTRY").Range("I2").Value = "NO" Then
Call Add_Data
TextBox6.Value = Sheets("BAZE").Range("B2").Value
TextBox5.Value = Sheets("ENTRY").Range("H2").Value
TextBox1.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 2, 0)
TextBox2.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 3, 0)
TextBox3.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 4, 0)
TextBox4.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 5, 0)
Do
Call randomCollection
TextBox5.Value = Sheets("ENTRY").Range("H2").Value
Loop Until Sheets("ENTRY").Range("I2").Value = "NO"
If TextBox6.Value = 10 Then
MsgBox "GAME IS OVER"
End If
End If
End Sub
i upload sample file
Private Sub CommandButton1_Click()
If Sheets("ENTRY").Range("I2").Value = "NO" Then
Call Add_Data
TextBox6.Value = Sheets("BAZE").Range("B2").Value
TextBox5.Value = Sheets("ENTRY").Range("H2").Value
TextBox1.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 2, 0)
TextBox2.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 3, 0)
TextBox3.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 4, 0)
TextBox4.Value = Application.WorksheetFunction.VLookup(TextBox5, Sheets("ENTRY").Range("B2:F11"), 5, 0)
Do
Call randomCollection
TextBox5.Value = Sheets("ENTRY").Range("H2").Value
Loop Until Sheets("ENTRY").Range("I2").Value = "NO"
If TextBox6.Value = 10 Then
MsgBox "GAME IS OVER"
End If
End If
End Sub