Re: Correct sintax for Like
'this does work
private Sub Command1_Click()
Dim vntIn
vntIn = InputBox("input a letter")
If vntIn Like "[A-C]" then
MsgBox "input= A,B or C"
ElseIf vntIn Like "[DEFabc]" then
MsgBox "input = D,E,F, a,b or c"
ElseIf vntIn Like "*#" then
MsgBox "input: a keystroke and a number"
End If
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Re: Correct sintax for Like
Thanks for your suggestion. But I think the "Like" operator does not very useful when the selective strings have no comparison part except for the meanings. For example, how can we use "like" to translate the following:
If x in ("cat", "dog", "fish") then .....
Anyway, thanks again.
Regards,
Michi