Unanswered: vba like-operator and escape characters
I want to check whether a string contains the character sequence "#N/A" (in vba). I've tried to use the "like-operator" to perform the check. Unfortunately, "#" is reserved as a wildcard character (any numeric character). How can I tell the like-operator to treat "#" as a usual character? I've tried "\#", but this doesn't work.
Use the VBA function InStr to find the character sequence you want. See Help for the full syntax. This will return a number of the first character that matches your sequence or a 0 if no match is found. For example:
If InStr("There is an error #n/a","#n/a") Then
MsgBox "#N/A has been found"
Msgbox "No error has been found