Hi, I have an event code below which is a portion in a larger code that triggers when a certain selection is made from a drop-down menu. That selection is "Unexcused Absence"
If Unexcused Absence is selected from the drop-down menu, a pop-up message asks if the employee is using a Multiple and if they click yes, it writes the word Multiple one cell to the right of that one. I am wondering if there is a simple code line I can put in that will make this event procedure not run if the Date is between and including 12/18 thru 12/31 of any given year. The date is always in Cell C6 of the sheet. There are two variables declared for a separate portion of the macro which i believe could be used here: Dim StartDate As Date, EndDate As Date.
StartDate = DateSerial(Year(d), 12, 18)
EndDate = DateSerial(Year(d), 12, 31)
Trying to keep the post concise so I hope this is enough info, but if more is needed, let me know. Thank you!
VBA Code:
If Not Intersect(Range("E:E"), Target) Is Nothing Then
Application.EnableEvents = False
If Target = "Unexcused Absence" And Target.Offset(, -1) <> "CAS" Then
Answer = MsgBox("Is this employee using a Multiple?", vbYesNo)
If Answer = vbYes Then
Target.Offset(, 1) = "Multiple"
End If
End If
If Unexcused Absence is selected from the drop-down menu, a pop-up message asks if the employee is using a Multiple and if they click yes, it writes the word Multiple one cell to the right of that one. I am wondering if there is a simple code line I can put in that will make this event procedure not run if the Date is between and including 12/18 thru 12/31 of any given year. The date is always in Cell C6 of the sheet. There are two variables declared for a separate portion of the macro which i believe could be used here: Dim StartDate As Date, EndDate As Date.
StartDate = DateSerial(Year(d), 12, 18)
EndDate = DateSerial(Year(d), 12, 31)
Trying to keep the post concise so I hope this is enough info, but if more is needed, let me know. Thank you!
Last edited: