Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default TextBox Values

Hello!,

How I can limit textbox (or combo) from accepting only numbers and
Minimum is zero and maximum is Number of days in a specific month?

say for eg. In comboBox1 i select february then textBox1 shoul accept
only from 0 to 28 or in case of april 0 to 30, May 0 to 31 etc...

based on the value in textbox1 textbox2 is calculated, so textbox1
should not be allowed to be empty to avoid an error

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default TextBox Values


The simplest way for beginners is to validate the data once it is
entered.
Private Sub TextBox1_Change()
t = TextBox1.Text
If Not IsNumeric(t) Then MsgBox "Non numeric character "
End Sub

For experts, each keystroke can be monitored.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=566924

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
Using a DO loop to add values into a textbox Ian B Excel Programming 2 September 12th 05 07:07 PM
Textbox values browie Excel Programming 3 June 20th 05 02:52 PM
How do I add TextBox.values? WTG Excel Programming 4 February 28th 05 09:38 AM
How do I add TextBox.values? WTG Excel Discussion (Misc queries) 1 February 27th 05 08:25 PM
How do I add TextBox.values? WTG Excel Worksheet Functions 1 February 27th 05 08:22 PM


All times are GMT +1. The time now is 11:42 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"