Private Sub Workbook_BeforePrint(Cancel As Boolean)
dim x , y '可以定义确定的类型,如 dim a as double,以提高程序运行效率。默认是 varient 类型
On Error GoTo E '标签未定义,在合适的位置定义标签 E:
E: '定义标签
x = Format(Date, "yyyymmdd") '变量未定义
y = [d11].Value'变量未定义
If Left(y, 8) = x Then
[d11] = y + 1
Else
[d11] = x & "001"
End If
End Sub