Cells(a, b - 1) 这个条件有可能让 列为0 出错
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
a = Selection.Row
b = Selection.Column
If b >= 2 And b <= 7 And Cells(a, b) = ""Then
if Cells(a, b - 1) <> "" then
AppActivate "Mozilla Firefox"
end if
End If
End Sub
你的if前加一句:
if b=1 then exit sub