打印编号自动累加
Sub Macro1()
Sheet1.PrintOut
Sheet1.Range("O2") = Sheet1.Range("O2") + 1
Sheet1.Range("J2") = "RWSH-" & Format(Now(), "yyyy-mm-dd-") & Cnum(Sheet1.Range("O2"))
End Sub
Function Cnum(i) As String
If i < 10 Then
Cnum = "00" & i
ElseIf i < 100 Then
Cnum = "0" & i
ElseIf i < 1000 Then
Cnum = i
End If
End Function
赞 (0)