lundi 17 octobre 2016

Excel VBA If range.value = something then

What I am looking for is this -

If a value in range of cells equals to some value or same value then it should show "Positive" else "Negative. But when I write like below syntax, it throws an error -

If range("F3:H5").value = "X" then

Msgbox "Positive result"

else

Msgbox "Negative result"

end if

Kindly help me with the right code.

Aucun commentaire:

Enregistrer un commentaire