LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with using the "Like"-Operator.

Markus,
the order of the operands is important. Also you need the
wildcards:

If "[7,8,9,10,11]" Like "*10*" Then
MsgBox "Found!"
Else
MsgBox "Not found!"
End If

HTH
Kostis

-----Original Message-----
Hi, I have just encountered a very strange problem when

comparing
strings:

Here is an example:

If "10" Like "[7,8,9,10,11]" Then
MsgBox "Found!"
Else
MsgBox "Not found!"
End If

The result is "Not found", although it should find the 10

inside the
other string. The strange thing is it finds 7,8 and 9,

but not the
two-digit numbers.

How can I get this to work?
Any help is appreciated.
Regards,
Markus
.

 
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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Is it possible to apply IF's to "operator" result.. nastech Excel Discussion (Misc queries) 3 August 11th 06 02:12 PM
program stuck at "Save Cancelled by Operator" MainelyPat Excel Discussion (Misc queries) 3 April 20th 06 06:23 PM
Excel no longer allows new formulas with division "/" operator SA Excel Programming 1 November 1st 03 07:07 AM


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