I'd like to check if in a string (with InStr
?) the combination of a single alphabetical letter and a number is to be found. In particular the letter can only be:
"R" or "B" or "G" or "Y"
While the numbers can go from 1 to 9.
Examples given:
R1 is legal
Y6 is legal
A2 is not legal
G10 is not legal
In this string only one instance of this combination can be found, and it is marked by an underscore "_" at the beginning. It can also happen that this combination is nowhere to be found.
I would like to avoid the trivial solution (which brings a lot of calculations that I don't need in my program) of a series of Or
, or an incredibly long Select Case
.
Is there any way to use a custom variable or wildcards here?