下面这个VBA程序是我在EXcel里面做的宏,但是为什么运行时,好像进入死循环一样,出不来?请高手解答,在线等!
Private Sub Worksheet_Change(ByVal Target As Range)If Cells(2, 4) = "a" Then
'MsgBox "1fsdafasdf"
Cells(9, 7) = 1
Cells(10, 7) = 1
ElseIf Cells(2, 4) = "b" Then
'MsgBox "2fsdafasdf"
Cells(9, 7) = 2
Cells(10, 7) = 2
ElseIf Cells(2, 4) = "c" Then
'MsgBox "3fsdafasdf"
Cells(9, 7) = 3
Cells(10, 7) = 3
Else
MsgBox "请在“D2”单元格中输入“手动”、“单用”或“两用”。"
End IfEnd Sub
Private Sub Worksheet_Change(ByVal Target As Range)If Cells(2, 4) = "a" Then
'MsgBox "1fsdafasdf"
Cells(9, 7) = 1
Cells(10, 7) = 1
ElseIf Cells(2, 4) = "b" Then
'MsgBox "2fsdafasdf"
Cells(9, 7) = 2
Cells(10, 7) = 2
ElseIf Cells(2, 4) = "c" Then
'MsgBox "3fsdafasdf"
Cells(9, 7) = 3
Cells(10, 7) = 3
Else
MsgBox "请在“D2”单元格中输入“手动”、“单用”或“两用”。"
End IfEnd Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货