|
楼主 |
发表于 2017-9-10 08:55
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 zjdh 于 2017-9-10 08:57 编辑
"录入单据“页的宏改为
Private Sub Worksheet_Activate()
If Mid(Cells(2, 22), 3, 4) * 1 <> Year(Now()) Or Mid(Cells(2, 22), 7, 2) <> Format(Month(Now()), "00") Then
Cells(2, 22) = "WZ" & Year(Now()) & Format(Month(Now()), "00") & "0001"
End If
If Mid(Cells(3, 22), 3, 4) * 1 <> Year(Now()) Or Mid(Cells(2, 22), 7, 2) <> Format(Month(Now()), "00") Then
Cells(3, 22) = "LT" & Year(Now()) & Format(Month(Now()), "00") & "0001"
End If
ScrollArea = "$A$1:$T$23"
End Sub |
|