INSTR and not instr

User avatar
sal21
PlatinumLounger
Posts: 4343
Joined: 26 Apr 2010, 17:36

INSTR and not instr

Post by sal21 »

I need to ceck if MYvar contain "ok" and not contain "tutto"

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: INSTR and not instr

Post by HansV »

Code: Select all

    If MyVar Like "*ok*" And Not MyVar Like "*tutto*" Then
or

Code: Select all

    If InStr(MyVar, "ok") > 0 And InStr(MyVar, "tutto") = 0 Then
Best wishes,
Hans