I have the below code that I am trying to have VarYear equal 2021 if the current date is before October 1 and 2022 if the date is after October 1. Here is my code:
Dim NowDate As Variant
Dim NowYear As Var
NowDate = Date
NowYear = Year(NowDate)
Dim VarYear As Variant
If NowYear < 10 / 1 Then
VarYear = NowYear
ElseIf NowYear >= 10 / 1 Then
VarYear = NowYear + 1
End If
I know it probably has something to do with not assigning the variables correctly but I have troubleshot a couple things with no solution.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…