Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 5th, 2007, 06:16 AM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default DAY of the week

Hello again,

Is there a specific code to get the day of the week?
The value that should be returned is monday, tuesday etc.
I've got the Wrox programmer's reference, but I can't find it anywhere.

Thanks for the help,
Wim
 
Old February 5th, 2007, 09:19 AM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I googled a bit by myself and found out that this should do:

range("A1").value = weekday(now()).

It doesn't return monday or tuesday but 2 and 3 instead.
To get the name of the week in full you can write in a cell

=text(now(),"dddd")
 
Old February 6th, 2007, 04:23 PM
Authorized User
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dim NameOfDay As String
NameOfDay = WeekdayName(DatePart("w", Now))
MsgBox NameOfDay



DaveG
 
Old February 7th, 2007, 06:44 AM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That was exactly what I was looking for!
thanks a lot,
Wim





Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the same day of the week. crabjoe Classic ASP Basics 3 February 27th, 2008 12:45 PM
Day of week finder mrjaygreene Classic ASP Basics 6 May 13th, 2006 04:43 PM
Conversion to 7 day week. kinouye BOOK: Beginning VB.NET Databases 0 December 3rd, 2005 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.