Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default force text/numbers in text box

is there a way to force my user to enter only numbers in a textbox?
and in other only letters?
theres quite a few textboxe's

some thing like this perhaps?

with me.
textbox1
textbox2
textbox3
..numbers.only

thanx all
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default force text/numbers in text box

Hi,

Right click each textbox, view code and paste this in to ensure numbers
only. Remove 'Not' to ensure letters only, Don't forget to change the name of
the text box as appropriate.

Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Value) And TextBox1.Value < vbNullString Then
MsgBox "Sorry, only numbers/letters allowed"
TextBox1.Value = vbNullString
End If
End Sub


Mike
"pswanie" wrote:

is there a way to force my user to enter only numbers in a textbox?
and in other only letters?
theres quite a few textboxe's

some thing like this perhaps?

with me.
textbox1
textbox2
textbox3
.numbers.only

thanx all

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default force text/numbers in text box

thanx rick...

one more Q. how will i go to the last cell in column b and make that the
caption for label1?


As for your second item, this will do it...

Label1.Caption = Cells(25, "B").Value

Rick


"pswanie" wrote in message
...
i got a few labels on a userform. most of them in a frame.

1) few of them need to show data in sheet1 colum a cell 1 untill empty row

2) other just need to show sheet1 column b cell 25



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 TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
excel save as csv - force text qualifier on every text field Newbie-Don Excel Discussion (Misc queries) 6 April 2nd 23 08:33 PM
force numbers as text as seen on screen craig331 Excel Discussion (Misc queries) 1 April 5th 06 01:53 AM
force Excel to treat numbers as text GottaRun New Users to Excel 2 March 18th 06 10:11 PM
force evaluation of text Light Excel Discussion (Misc queries) 3 March 15th 06 02:54 PM


All times are GMT +1. The time now is 01:59 AM.

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

About Us

"It's about Microsoft Excel"