View Single Post
  #2   Report Post  
Rob Bovey
 
Posts: n/a
Default

"Greg B" wrote in message
...
I have a userform where the person puts in totals
How do I get excel to not allow a total more than 180 in a textbox.
Also is there a chance of excel giving a warning about this total


Hi Greg,

Here's one very simplified way to accomplish this:

Private Sub TextBox1_Change()
If Val(TextBox1.Text) 180 Then
MsgBox "180 is the maximum allowed."
TextBox1.Text = ""
End If
End Sub

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm