OR and AND conditions in IF statement

Hiii,
i want to check if the statement contains “agreed”, “approved”, “go ahead” or “disagree”
how can i write the condition in the IF statement?

If MyText is your string variable, use MyText.Contains("agreed") OrElse MyText.Contains("approved") OrElse MyText.Contains("go ahead") OrElse MyText.Contains("disagree").

If you need to process each of these separately, I recommend taking each condition and putting them in separate If statements to handle each differently.

Hi,

Hope the following helps you.

img20200529-5

If number of your condition change, please add keyword to array (arrConditions).

Regards,

3 Likes

Very clean solution @Yoichi. I tend to forget/not think of where it would be wise to implement functions.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.