LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Verify Textbox Information is a Number and Not Text

So I have a UserForm asking for a couple of different values. These
values should all be numbers.

I already added so that the program doesn't continue if the Textbox
value is "" (blank).

How do I make it not continue if the Textbox value is not a number,
i.e. text only, or text and a number?

I've tried the following two ideas:

XVariance = UserForm1.TextBoxXVariance.Text

1. If Val(XVariance)/1 = Val(XVariance) then ...... else exit sub end
if
2. Const TextCharacters = "abcdefghijklmnopqrstuvwxyz" and If
InStr(XVariance, TextCharacters) Then Exit Sub

I just want to make sure the Textbox contains a number using only
0123456789 and a decimal point.

Seems pretty simple and straightforward, but I'm stuck.

Thankx, NP
 
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
Assigning Row Number to TextBox Ayo Excel Discussion (Misc queries) 0 May 30th 08 08:24 PM
how to format text in textbox? ghost Excel Discussion (Misc queries) 1 May 18th 08 10:41 AM
Textbox text visibility bcelestia Excel Discussion (Misc queries) 2 January 11th 07 08:47 AM
Verify information and input a value Richard Excel Discussion (Misc queries) 0 June 22nd 06 09:36 PM
Userform textbox number formats PhilM Excel Discussion (Misc queries) 2 June 7th 06 11:08 AM


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