vba编译错误:语法错误

If Trim(.Cells(3, 2)) = "" Then MsgBox "请输入"起点坐标X"!", vbInformation, "提示": Exit Sub '

显示语法错误 。

改成这样就行了:
With ActiveSheet
If Trim(.Cells(3, 2)) = "" Then MsgBox "请输入“起点坐标X”!", vbInformation, "提示": Exit Sub
End With

1.这行代码必须用在with语句里面
2.文本内容用中文标点,可以避免转义