if he cell 4 e has not ABCD AND CELL 5 6 Mid position not M
DISPLAY MSG BOX
AND if cell 4e has = ABCD OR NOT abcd
do something
The below code i tried
when it is not ABCD AND =m
it shows msg box
what is wrong in this logic
IF Ucase(aSheet.cells(4, "e")) <> "ABCD" AND mid(aSheet.Cells(5,"e"), 6, 1) <> "M" THEN
MsgBox ("Excell Cell E5 6th position should be M'")
MyScreen.Sendkeys ("<pf3>")
Exit Sub
End IF
if Ucase(aSheet.cells(4, "e")) <> "ABCD" or = "ABCD"
DO SOMEHTING
END IF