My delay codes are always 3 digits. Two letters a dash (-) and a number. I am trying to use a single line of code to detect either MT or DA, the actual classification number is irrelevant, so I want the message box to fire on the two letters only.
The code looks right, but it doesn't fire as it should. If I take out the wild card it works. I think I have a problem with the concatenation, but I'm not sure. I tried putting () brackets around it but that was not help.
Additionally I tried using an or statement to capture the MT code on the other side but got nothing but an error code for type mismatch. Any ideas?
If Range("L24").Value = "DA" & "*" Then
MsgBox "The flight had a Maintenance delay"
Else
End If
A simple solution to this kind of problem would be to ignore the wildcard altogether and check the first two digits:
If Left(Range("L24").Value, 2) = "DA" Then