Excel Macro Nightmares!
Want to do something really simple:
Given a date, determine what day of the week it is.
Does VBA have a DayOf Week (dToday) type function, 'cos I can't find it!!!! [img]images/smilies/mad.gif[/img]
TIA,
Alex
Given a date, determine what day of the week it is.

Does VBA have a DayOf Week (dToday) type function, 'cos I can't find it!!!! [img]images/smilies/mad.gif[/img]
TIA,
Alex
You can convert this number to the day (Monday, Tuesday etc) by using the IF function, you can nest up to 7 IF functions together, so ideal for day of the week (you only need 6)
=if(weekday(DATE))=1,"Monday",if(weekday(DATE))=2, "Tuesday"......,"Saturday"))
Drop me an E-Mail if you need to know exactly how to do it.
Stuart
=if(weekday(DATE))=1,"Monday",if(weekday(DATE))=2, "Tuesday"......,"Saturday"))
Drop me an E-Mail if you need to know exactly how to do it.
Stuart
Thanks,
I just needed to know if it was a weekend, i.e. =1 or =7.
Next thing to do is add a 'button' or similar to a worksheet such that I can fire an event when a user clicks on it.
Any ideas?
Alex
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
Dec 28, 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
Nov 18, 2015 07:03 AM
bluebullet29
General Technical
9
Oct 5, 2015 02:17 PM



function. This will return a code of 1 for Sunday, 2 for Monday, etc. More info is in the help file.