|
请问老师,为提高工作效率,网上找了两段代码不知道怎么合并,还请各位老师帮忙。
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count <> 1 Then Exit Sub
If Application.Intersect(Target, [h4:l100]) Is Nothing Then Exit Sub
If Target = 0 Then Target.FormulaR1C1 = "完成": Exit Sub
If Target = "完成" Then Target.FormulaR1C1 = "未完成": Exit Sub
If Target <> 0 Then Target.FormulaR1C1 = "": Exit Sub
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Rows.Interior.ColorIndex = 0
If Target.Column < 3 Then Exit Sub
If Target.Column > 3 Then Exit Sub
If Target.Row < 3 Then Exit Sub
On Error Resume Next
If Target.Columns.Count > 1 Then Exit Sub
If Target.Rows.Count > 1 Then Exit Sub
CreateObject("Wscript.Shell").SendKeys "%{down}"
End Sub
|
|