Change this:
If G1 0 Or G1 < 21 Then
to this:
If G1 <= 0 Or G1 21 Then
and add "Loop" after "End If"
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______
"Greg B" wrote in message
...
I am hoping for some help, I have an inputbox that asks for the amount
between 0 and 21 the trouble I am having is how to write the code. here is
what I am trying
Do While Sheet2.Range("A21").Value = 0
Dim G1
G1 = InputBox("WHAT WAS THE SCORE FOR THE " & Sheet2.Range("B10").Value &
" AGAINST THE " & Sheet2.Range("B11").Value & " FOR THIS ROUND?")
If G1 0 Or G1 < 21 Then
MsgBox "THE SCORES MUST BE BETWEEN 0 AND 21", vbInformation
Else
Sheet2.Range("B21").Value = G1
End If
I have made a mistake somewhere and can not put my finger on it. I need
the code to warn that the number is not between 0 and 21 and if it is not
in these number to loop until the answer is correct.
Thanks
Greg