如何将我的 Excel 编码为 VBA?从右边开始,Target.Offset(0, -4).Value =
我不知道在 VBA 中怎么说:(Text(TODAY(), "MM") & Text(TODAY(), "DD") & Text(TODAY(), "yyyy")) & "-" . iVal
这是为了根据日期自动记录记录。这是整个代码:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Application.EnableEvents = False
Target.Offset(0, 2).Value = Date
Target.Offset(0, 4).Value = "Open"
Dim iVal As Integer
iVal = Application.WorksheetFunction.CountIf(Range("H1:H5000"), Date)
Target.Offset(0, -4).Value = (Text(TODAY(), "MM") & Text(TODAY(), "DD") & Text(TODAY(), "yyyy")) & "-" . iVal
Application.EnableEvents = True
End If
End Sub