如判断A1与B1是否一样:
if [A1]=[B1] then MsgBox ("一样")else MsgBox ("不一样")end if
if range("a1").value=range("b1").value then msgbox "数据相同!"else msgbox "数据不相同!"endif