Solved

Get Day name from date

Posted on 2014-12-08
5
43 Views
Last Modified: 2016-07-12
Hi Experts

In VBA how can I get the day name when specifying a date.
So how can I extract the day name from now()
e.g. Monday etc.

Thanks
0
Comment
Question by:simsima_7876
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 250 total points
ID: 40486881
Format(Now(),"dddd")

Open in new window

0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 40486884
You can use the Weekday function to get the day of the week from a date, and then use the WeekdayName function to get the name.
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40486904
Just to be clear for the OP , this is what Shaun Kline suggested:
WeekdayName(Weekday(Now()))

Open in new window

0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 250 total points
ID: 40486996
That won't work in an international environment, except if extended:

    strWeekday = WeekdayName(Weekday(Date), , vbSunday)

So Format is much simpler and easier:

    strWeekday = Format(Date, "dddd")

/gustav
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question