Beatrice
Board Regular
- Joined
- Sep 17, 2019
- Messages
- 85
- Office Version
- 2019
- Platform
- Windows
Here is my logic, which works fine in the excel formula:
=IF(AND(OR(C3<>"x",C4<>"x"),C6="HK"),"error","ok")
but how about turn it to VBA?
My trial:
it alarms me for error but I am not sure how to fix it.
could anyone please help me?
Thanks a lot in advance.
=IF(AND(OR(C3<>"x",C4<>"x"),C6="HK"),"error","ok")
but how about turn it to VBA?
My trial:
VBA Code:
Sub CheckConflict()
If Range("C3") <> "x" Or Range("C4") <> "x" Then
If Range("C6") = "HK" Then
MsgBox "Are you sure to proceed?", vbYesNo + vbExclamation, "Conflict Found"
End If
End Sub
it alarms me for error but I am not sure how to fix it.
could anyone please help me?
Thanks a lot in advance.