LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Need help with the Like Operator

Excel gurus:

Users enter numerical data into input boxes in my UserForms
in text form like $1,345,561.50 or as arithmetic expressions
like $40,000*(1.03)^2.5, and to check that no extraneous
characters have been inadvertently keyed in, I do the following:

Sub MyTextBox_AfterUpdate
If MyTextBox.Text Like "*[a-zA-Z`~!@#&_=:;|\<'?{}""]*" Then
MsgBox "Sorry, you have entered an illegal character."
End If
End Sub

Rather than doing it that way, is it possible to somehow use the
Like operator in a complementary manner, in which the arguments
enclosed in brackets are the symbols that are permitted;
that is, [0-9$,.+-*/^()]

-- Dennis Eisen

 
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
Operator for Contains Leanne M (Aussie) Excel Worksheet Functions 2 October 21st 08 11:01 AM
XOR Operator - How? Randy Brown Excel Discussion (Misc queries) 3 April 8th 06 09:47 PM
what does ~ operator mean? Todd Excel Discussion (Misc queries) 3 November 22nd 05 05:30 PM
OR Operator Freddy Excel Worksheet Functions 2 April 17th 05 06:11 PM
Can the AND operator be of use here? Milind Excel Programming 3 July 27th 03 11:17 PM


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