|
本帖最后由 金樽空对月 于 2015-9-15 13:55 编辑
代码如下:- Private Sub CommandButton1_Click()
- Application.ActiveSheet.PrintOut copies:=1
- With Sheets("Sheet1")
- If .[B1] = "" Or Val(Mid(.[B1].Text, 5, 2)) <> Month(Now()) Then
- .[B1] = Format(Now(), "YYYYMM") & Format(1, "0000")
- Else
- .[B1] = Format(Now(), "YYYYMM") & Format(Val(Mid(.[B1].Text, 8, 4)) + 1, "0000")
- End If
- End With
- End Sub
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|