mercredi 24 février 2016

If / Or formula not giving the correct True or False statement

I have an If formula as part of my macro code which doesn't seem to be working in the correct manner.

The below code calculates the rCell.Offset and always applies it as being True, I have had examples where it equals 112, 113, 118 etc and it is populating the desired cell as Option 2.

If rCell.Offset(0, -2).Value = "101" Or "102" Then
        rCell.Value = "Option 2"
        Else
        rCell.Value = "Option 1"
        End If

Am I missing something?

Aucun commentaire:

Enregistrer un commentaire