Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Issues when using UserForm box after clicking a Checkbox RobGolf72 Excel Discussion (Misc queries) 1 October 9th 07 07:51 PM
Excel UserForm issues: Textboxes cannot be blank [email protected] Excel Programming 1 January 8th 07 09:05 AM
multi-column listbox on userform, multiple issues KR Excel Programming 2 February 15th 06 07:55 PM
Textbox in userform Harald Staff Excel Programming 0 September 8th 04 11:51 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"