your first example works because vba performs an implicit coercion to a boolean (0 = false, any other number = true). the second fails because your explicit comparison is false (True = -1, not the 2 your InStr returns). as steffen said it is much better to compare to 0.