Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row >= 2 And Target.Row <= 10 And Target.Column >= 1 And Target.Column <= 4 Then MsgBox "OK" End If End Sub
我是这样写的: Dim rng As Range
Set rng = Application.Intersect([A2:D10], Target)
If Not rng Is Nothing Then MsgBox "ok" End If但是在我这个工作表里有个组合框combobox1,当我选择组合框里任何一条数据时都无穷无尽的弹出 MsgBox "ok" 对话框,不知道错误出在哪里...
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 2 And Target.Row <= 10 And Target.Column >= 1 And Target.Column <= 4 Then
MsgBox "OK"
End If
End Sub
Set rng = Application.Intersect([A2:D10], Target)
If Not rng Is Nothing Then
MsgBox "ok"
End If但是在我这个工作表里有个组合框combobox1,当我选择组合框里任何一条数据时都无穷无尽的弹出 MsgBox "ok"
对话框,不知道错误出在哪里...
如果是应该在Sheet1的某个事件中执行,怎么会无穷无尽的弹出 MsgBox "ok" ?
Dim rng As Range
Set rng = Application.Intersect([A2:D10], Target)
If Not rng Is Nothing Then
MsgBox "ok"
End If
End Sub并且在组合框的change方法里有简单的语句,结果在sheet1的组合框里一选择某条记录时就出现 “OK”,按"ok"对话框上的确定按钮后又弹出“OK”对话框,无穷尽的下去...