calendar week

R

Roman Töngi

I' m looking for a date or calendar objekt/funktion that provides
the following:
- I have a date(e.g. 5/20/2004) and want the corresponding calendar week of
this date.
- Does anybody know how to classify this calendar week to the right month
of the year?

Thanks for help
Roman Töngi
 
J

Jay Freedman

Hi Roman

Given a date expression (either a String or a Date data type) called
TheDate, this statement will return the week number in TheWeek:

TheWeek = DatePart("ww", TheDate)

There are two optional arguments I've omitted, for specifying the first day
of the week and how the first week of the year is determined. When you omit
them, the function uses the system settings. See the VBA help for DatePart
for details.

An alternative is to use the Format function. Notice the different order of
arguments:

TheWeek = Format(TheDate, "ww")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top