|
<p>请教各位,下面代码中的两个功能,启用了任何一个,另一个就失效。如何做到互不干扰?</p><p>rivate Sub Worksheet_SelectionChange(ByVal Target As Range)<br/> On Error Resume Next '功能1:有效性选项<br/> If Target.Validation.Type = 1 Then<br/> Exit Sub<br/> Else<br/> SendKeys "%{down}"<br/> Target.Value = Split(Target.Validation.Formula1, ".")(1) '<br/> End If '</p><p> If ActiveCell.Column > 4 And ActiveCell.Locked = False Then '功能2:单击选中,再击取消<br/> If ActiveCell.Column < 9 And ActiveCell.Locked = False Then<br/> If ActiveCell.Cells(1, 1) = "" Then<br/> ActiveCell.Cells(1, 1) = "√"<br/> Else<br/> ActiveCell.Cells(1, 1) = ""<br/> End If<br/> End If<br/> End If <br/>End Sub<br/></p> |
|