答案 0 :(得分:0)
这样的事情:
If Not f Is Nothing Then
With f.Offset(0, 2)
.Value = .Value + 1
End With
Else
Set f = rngCodes.Cells(rngCodes.Cells.Count).End(xlUp).Offset(1, 0)
f.Value = val
f.Offset(0, 1).Value = "enter description"
f.Offset(0, 2).Value = 1
f.Offset(0, 3).Value = format(now(), "yyyy-MM-dd hh:mm:ss")
End If