View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mastermind mastermind is offline
external usenet poster
 
Posts: 36
Default Userform/Textbox Issues

I have a userform with a few textboxes, all of which run the same
code. I was wondering if there was a way to link them to the same
section of code. The code each one runs is below:

Private Sub TextBox1_Change()
If IsNumeric(TextBox1.Text) Then
If TextBox1.Value < 1 Or TextBox1.Value 12 Then
TextBox1.Value = Month(Date)
MsgBox "This box is intended to indicate the month and" &
_
vbCrLf & "will only accept values between 1 and 12"
End If
Else
TextBox1.Value = ""
End If
End Sub