Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Determining the Week of the Year.
by Allen Wyatt
(last updated February 8, 2014)
You may have a need to find out the current week of the year. For instance, your company may require to you utilize the week number for accounting or tracking purposes. VBA provides a handy function that allows you to quickly and easily determine the current week of the year:
iThisWeek = DatePart("ww", Date)
When executed, iThisWeek will be equal to the current week number. Notice that this example uses the Date function. If you want to determine the week number for a different date, simply substitute that date in place of the Date function.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12946) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Determining the Week of the Year.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
The Navigation pane can be a big help in moving around a document. If you want to make sure it is always displayed for your ...Discover More
Word allows you to create a macro that is run automatically whenever the program is started. If you want to bypass the macro, ...Discover More
Bookmarks can be very handy in a document. Word provides a VBA command you can use to easily select any of those bookmarks.Discover More
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.