|
发表于 2017-1-20 14:10
|
显示全部楼层
本楼为最佳答案
在原来的事件上加了点内容。- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Or Target.Column <> 16 Then Exit Sub
- r = Target.Row
- If Len(Target) = 0 Then
- Cells(r, 15) = "": Cells(r, 17) = ""
- Else
- Cells(r, 15) = Format(Date, "yyyy-m-d")
- Cells(r, 17) = Month(Date) & Cells(r, 4)
- End If
- End Sub
复制代码 |
|