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

I want to thank Melanie Breden and Doug Glancy for their suggestions regarding
the Like operator. After much research I finally stumbled upon what to do. The
solution is in inserting the ! character right after the opening bracket. The !
character immediately to the right of the opening bracket acts like a NOT
operator. Thus,

Sub MyTextBox_AfterUpdate
If MyTextBox.Text Like "*[!0-9$,.+-*/^()]*"
MsgBox "Sorry, you have entered and illegal character."
End If
End Sub

This will accept entries like $12,345.67 or
$52.27*(1.03)^2.5 and will reject entries containing an alphabetic characters
or extraneous symbols such as @ # { } [ ] \ ~ ` | \ <

Once again, thanks all.

-- 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 06:02 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"