请问能否将括号中的日期数据放到表中?这段代码是模块中写的,为设定工厂日历而设定的!每个财政年末都需要修改?有没有办法将它放到表中进行初始化,谢谢
Function GetP(A As Date) As String
Dim Re As String
If A >= CDate("2009-10-1") And A <= CDate("2009-10-23") Then
Re = "2010_P1"
ElseIf A >= CDate("2009-10-24") And A <= CDate("2009-11-20") Then
Re = "2010_P2"
ElseIf A >= CDate("2009-11-21") And A <= CDate("2009-12-25") Then
Re = "2010_P3"
ElseIf A >= CDate("2009-12-26") And A <= CDate("2010-01-22") Then
Re = "2010_P4"
ElseIf A >= CDate("2010-01-23") And A <= CDate("2010-02-19") Then
Re = "2010_P5"
ElseIf A >= CDate("2010-02-20") And A <= CDate("2010-03-26") Then
Re = "2010_P6"
ElseIf A >= CDate("2010-03-27") And A <= CDate("2010-04-23") Then
Re = "2010_P7"
ElseIf A >= CDate("2010-04-24") And A <= CDate("2010-05-21") Then
Re = "2010_P8"
ElseIf A >= CDate("2010-05-22") And A <= CDate("2010-06-25") Then
Re = "2010_P9"
ElseIf A >= CDate("2010-06-26") And A <= CDate("2010-07-23") Then
Re = "2010_P10"
ElseIf A >= CDate("2010-07-24") And A <= CDate("2010-08-20") Then
Re = "2010_P11"
ElseIf A >= CDate("2010-08-21") And A <= CDate("2010-09-30") Then
Re = "2010_P12"
Else
End If