Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform/TextBox Issues
I have mutlitple boxes on a userform that run the exact same code as
can be seen below. For the sake of efficiencey I would like all these textboxes to reference the same section of code, but I can't seem to get it to work. Can anyone help me with this problem? 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform/TextBox Issues
Hi Mastermind,
See a response at your later thread. --- Regards, Norman "mastermind" wrote in message oups.com... I have mutlitple boxes on a userform that run the exact same code as can be seen below. For the sake of efficiencey I would like all these textboxes to reference the same section of code, but I can't seem to get it to work. Can anyone help me with this problem? 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Font Issues when using UserForm box after clicking a Checkbox | Excel Discussion (Misc queries) | |||
Excel UserForm issues: Textboxes cannot be blank | Excel Programming | |||
multi-column listbox on userform, multiple issues | Excel Programming | |||
Textbox in userform | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |