ksohn
05-08-2012, 10:22 PM
Hi,
I was wondering if I could find some answer that I can adapt, but seems like there are none so here I go,
my first post!
I need a code that checks if today is January 1st - regardless of which year, because I want this code to work every year - and if it falls on either Friday or Saturday.
If today's date satisfies both conditions, then I want a msgbox to pop up and say "YES". If not, then "NO"
This is what I have for now:
If Weekday(NewYearsDay) = vbFriday Or Weekday(NewYearsDay) = vbSaturday Then
MsgBox "YES"
Else
MsgBox "NO"
End If
But where I struggle is the part where I actually declare what "NewYearsDay" is.. :(
Or maybe I need to approach it in an entirely different way.
Any help is appreciated!
I was wondering if I could find some answer that I can adapt, but seems like there are none so here I go,
my first post!
I need a code that checks if today is January 1st - regardless of which year, because I want this code to work every year - and if it falls on either Friday or Saturday.
If today's date satisfies both conditions, then I want a msgbox to pop up and say "YES". If not, then "NO"
This is what I have for now:
If Weekday(NewYearsDay) = vbFriday Or Weekday(NewYearsDay) = vbSaturday Then
MsgBox "YES"
Else
MsgBox "NO"
End If
But where I struggle is the part where I actually declare what "NewYearsDay" is.. :(
Or maybe I need to approach it in an entirely different way.
Any help is appreciated!