关于在EXCLE中,想实现,每一次打开该文档都会产生不同的流水号,流水号的形成是由当天的年月日加上该日打开此文档的次数。谢谢了的问题
我是用宏做的,基本能满足您的要求
今天无意中发现,我的附件被强行修改,代码全没了,只好重发了一个,纳闷2007。12。22
代码在thisworkbook下
Private Sub Workbook_Open()
Dim dda$, ddb$
Dim str$, strr$
On Error Resume Next
Application。
DisplayAlerts = False
str = Worksheets(“sheet3”)。Range(“a2”)
dda = Left(str, 8)
ddb = Year(Now()) & Format(Month(Now()), “00”) & Format(Day(Now()), “00”)
If dda = ddb Then
aa = GetSetting(appname:=”MyApp”, section:=”Startup”, key:=”aaa”, Default:=1)
strr = ddb & “-” & aa
Worksheets(“sheet3”)。
Range(“A2”)。Select
Selection。EntireRow。Insert
Worksheets(“sheet3”)。Range(“A2”) = strr
aa = aa + 1
SaveSetting “MyApp”, “Startup”, “aaa”, aa
Else
DeleteSetting “MyApp”, “Startup”
aa = GetSetting(appname:=”MyApp”, section:=”Startup”, key:=”aaa”, Default:=1)
strr = ddb & “-” & aa
Worksheets(“sheet3”)。
Range(“A2”)。Select
Selection。EntireRow。Insert
Worksheets(“sheet3”)。Range(“A2”) = strr
aa = aa + 1
SaveSetting “MyApp”, “Startup”, “aaa”, aa
End If
End Sub。