LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default Inputting numbers only in Text Box

Hi Anthony:

'This is also a way to test the input.

'/// Place the following on the Sheet

Private Sub CommandButton1_Click()
With UserForm1
.Show
.TextBox1.SelStart = 0
.TextBox1.SelLength = Len(.TextBox1.Text)
.TextBox1.SetFocus
End With
End Sub

'/// This is on the Userform

Private Sub CommandButton1_Click()

If IsNumeric(TextBox1.Text) Then
TextBox1.Text = TextBox1.Text
MsgBox "Your Number is " & TextBox1.Text, , _
"Good Luck TK"
UserForm1.Hide
Else
MsgBox "Please enter a valid Number "
With TextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End If
Exit Sub
End Sub

'Good Luck
TK


 
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
help with inputting code Morgan New Users to Excel 3 February 26th 10 12:24 AM
Having trouble inputting numbers past 09 it shows 0.10 in excel scary Excel Discussion (Misc queries) 4 May 14th 08 05:37 PM
Inputting numbers using a macro. wazcaster Excel Discussion (Misc queries) 1 September 10th 07 11:38 AM
inputting data Shanor Excel Discussion (Misc queries) 0 June 15th 06 10:50 AM
Auto fill text boxes in user form by inputting data in another Finny33 Excel Programming 1 September 13th 04 12:53 PM


All times are GMT +1. The time now is 04:53 PM.

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"