Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
week function in vba?
I don't know if one exists or not, but is there a function in VBA that would
return a number representing the week of the year (0-51, or 1-52) when passed a date? similar to how year() or day() pulls out the year or day portion of a given date? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
week function in vba?
Make sure you have the Analysis toolpak addin and use weeknum(now()) to get
current week number -- -John Please rate when your question is answered to help us and others know what is helpful. "badazizi" wrote: I don't know if one exists or not, but is there a function in VBA that would return a number representing the week of the year (0-51, or 1-52) when passed a date? similar to how year() or day() pulls out the year or day portion of a given date? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
week function in vba?
You would use the DatePart function with "ww" as the 1st argument (with the
date as the 2nd argument). There are optional 3rd and 4th arguments which can modify how DatePart functions, so you should look this function up in the help files (type DatePart and then, with the text caret in or next to the word, hit the F1 key). Rick "badazizi" wrote in message ... I don't know if one exists or not, but is there a function in VBA that would return a number representing the week of the year (0-51, or 1-52) when passed a date? similar to how year() or day() pulls out the year or day portion of a given date? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help required on week function | Excel Worksheet Functions | |||
Week vs. Week VBA Function | Excel Programming | |||
Week Number Function | Excel Programming | |||
Day of week function needed | Excel Worksheet Functions | |||
custom function for the day of the week | Excel Programming |