Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correcting If statement looking for multiple strings
#2
Solved: 10 Years, 10 Months ago
GroupName="CLIENT DOCUMENTS"
Code:
If not strcomp(GroupName,"CLIENT DOCUMENTS - WBS",1)=0 or  strcomp(GroupName, "COMMISSION REPORTS BY SUB / BRANCH / REP",1)=0 or  strcomp(GroupName,"BRANCH REPORT SEARCHES",1)=0 or strcomp(GroupName, "SUB-FIRM REPORT SEARCHES",1)=0 or  strcomp(GroupName,  "FIRM REPORT SEARCHES",1)=0    then
    '......................... <your code>.......................................
    
End If

'*******************
'alternatively you can also go for switch case (better performance over 'the above)
GroupName="something"
Code:
Select Case GroupName
Case "CLIENT DOCUMENTS - WBS"
    'msgbox  "CLIENT DOCUMENTS - WBS"
Case  "COMMISSION REPORTS BY SUB / BRANCH / REP"
'    msgbox "COMMISSION REPORTS BY SUB / BRANCH / REP"
Case "BRANCH REPORT SEARCHES"
    'msgbox "BRANCH REPORT SEARCHES"
    Case  "SUB-FIRM REPORT SEARCHES"
        'msgbox  "SUB-FIRM REPORT SEARCHES"
        Case else
            '*******************************your code here******************************************************
    msgbox "not in list"
End Select
Reply


Messages In This Thread
RE: Correcting If statement looking for multiple strings - by ravi.gajul - 10-27-2011, 11:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Wink compare strings and perform action Forrest Gump 4 26,512 09-06-2011, 11:55 AM
Last Post: Rohan
  If statement with multiple conditions mv8167 4 13,299 08-20-2011, 08:34 PM
Last Post: Arul

Forum Jump:


Users browsing this thread: 1 Guest(s)