Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default User Form Controls



(1) Use VBA code to restrict the input to numbers like so:
(assuming that the textbox is called textbox1)

if Not IsNumeric(Textbox1.Text) then
msgbox "You must only enter numbers"
TextBox1.Text = Empty
End if

(2) Set the MaxLength property of the textbox to 4 to
restrict the length to a 4 character input.


Zaid Qureshi
-----Original Message-----
Hi all,

Is it possible within a excel user form to set a text box
to:

1) only accept numbers
2) only accept a set number of characters

Ie the user can only input a 4 number code.


Ben E
.

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
Lost Form Controls Vlado Sveda Excel Discussion (Misc queries) 2 December 13th 07 02:54 PM
Form controls in Excel 07 New to Excel 07 Excel Discussion (Misc queries) 1 July 30th 07 04:43 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
User Form Controls Zaid Qureshi Excel Programming 0 August 29th 03 12:40 PM
user form controls chris gee Excel Programming 0 July 15th 03 12:05 AM


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