|
不确定,供参考
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sro, sco, ro, co
On Error Resume Next
Application.EnableEvents = False
Set mysheet1 = ThisWorkbook.Worksheets("Sheet1")
sro = Selection.Row
sco = Selection.Column
If sro > 1 And sco > 1 And sco <= 15 Then
ro = Target.Row
co = Target.Column
If ro = 500 Then
mysheet1.Cells(ro - 497, co + 2).Select
End If
If ro > 1 And ro < 10 Then
mysheet1.Cells(ro + 1, co).Select
End If
End If
If Target.Count > 1 Or Target.Column <> 2 And Target.Column <> 4 And Target.Column <> 6 And Target.Column <> 8 And Target.Column <> 10 And Target.Column <> 12 Then
Application.EnableEvents = True
Exit Sub
End If
If Target <> "" Then
Target.Offset(, -1).Value = Format(Date, "YYYY/MM/DD")
Else
Target.Offset(, -1).Value = ""
End If
Application.EnableEvents = True
End Sub |
评分
-
1
查看全部评分
-
|