EXCEL单元格填充后怎样自动添加时间批注代码?
Private Sub Worksheet_Change(ByVal TargetAs Range) On Error Resume Next For Each c In Target With c .AddComment .Comment.Text Text:=&quot;&quot; & Now End With NextEnd Sub如需要在j4:p5000范围内单元格中实现此功能,则改成:Private Sub Worksheet_Change(ByVal TargetAs Range) On Error Resume Next For Each c In Target If c.Column > 9 And c.Column < 17 And c.Row > 3 And c.Row <5001 Then With c .AddComment .Comment.Text Text:=&quot;&quot; & Now End With End If NextEnd Sub
页:
[1]