+ Reply to Thread
Results 1 to 4 of 4

Include week number in filename

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Ottawa
    MS-Off Ver
    Excel 2007
    Posts
    59

    Include week number in filename

    Hi everyone,
    I need a bit of help with one of my macros. The macro below saves a sheet with a specific file name, but I would also like to add the current week number at he end of the file name. i.e Test-WK36.csv
    Please Login or Register  to view this content.
    Is there a formula that I could add to the macro so that it would include the week num?

    Thanks.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Include week number in filename

    you can use the formula weeknumber to determine the week.

    In the code you can refer to that cell.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: Include week number in filename

    Hello,

    I found something from this website http://www.cpearson.com/excel/WeekNumbers.aspx and implemented it in your code.

    Hope it helps

    Please Login or Register  to view this content.
    Thanks

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Include week number in filename

    Hi,

    You'll need to tell us how you define week number. e.g.
    1. The integer of the days since January 1st divided by 7 plus 1
    2. Does the day count start on the 1st Sunday,Monday...etc, of the year?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. (ALT-F8) Some of my macro names include the filename also, why?
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2017, 07:30 PM
  2. [SOLVED] Rewrite existing code to include date in filename
    By MissaLissa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2013, 01:03 PM
  3. [SOLVED] Edit existing macro to include week change
    By adamsurpren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 08:11 AM
  4. Replies: 2
    Last Post: 03-16-2012, 08:04 AM
  5. 6 Day Work Week, Using Duration, Include Saturdays
    By lil_ern63 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-20-2008, 12:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1