Private Sub Workbook_Open()
Sheets("面板").Activate
Dim dt, aa
If [h2]"" Then
aa = Split([h2].Value, "-")(0)
If DateSerial(Left(aa, 4), Mid(aa, 5, 2), Right(aa, 2))Date Then
dt = Year(Date) & Format(Month(Date), "00") & Format(Day(Date), "00")
[h2] = dt & "-001"
End If
Else
dt = Year(Date) & Format(Month(Date), "00") & Format(Day(Date), "00")
[h2] = dt & "-001"
End If
Call Proed
End Sub
Sub NEWDJ()
Call ClearData面板
aa = Val(Split(NOH, "-")(1))
[h2] = Left(NOH, 9) & Format(aa + 1, "000")
End Sub
提示运行错误:下标越界
求修改
|