LucasSeveryn
LucasSeveryn

Reputation: 6272

To check if a string contains an element from a list (of strings)

Is there any way to do that in VBA other than manually looping through the array and testing each element separately?

Upvotes: 0

Views: 2181

Answers (1)

Preston
Preston

Reputation: 8187

Check out A.S.H's answer below, Application.Match is the way to go. This will throw Error 2042 if the element is not in the array.

Answer mentioned: Checking if Value is Present in an Array

MSDN: https://msdn.microsoft.com/en-us/library/bb239415(v=office.12).aspx

Upvotes: 1

Related Questions