+ Reply to Thread
Results 1 to 9 of 9

Weekly Date Changes

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Weekly Date Changes

    Hello,

    I have an excel file with dates for the week located across columns D5:H5 (only M-F). I need a macro that updates the these cells to the dates for the next week. Ideally this would update months/years at the beginning of a new month/year as well.

    Any help is much appreciated!
    Last edited by morph89; 12-04-2012 at 03:56 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Weekly Date Changes

    Take the value in D5 and add 7 to it - same for the other dates. Crossing into new months/years will be handled automatically.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-04-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Weekly Date Changes

    Pete_UK,

    Thanks for the quick response! I should preface that I don't have much experience with VBA however. What would this code look like? I tried using some other modules I found online but they only work within a single column, not across columns

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Weekly Date Changes

    This is just one line of the macro:

    Please Login or Register  to view this content.
    Do think you could take it from there?

    Pete

  5. #5
    Registered User
    Join Date
    12-04-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Weekly Date Changes

    Alright, I got it working. Thank you!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Weekly Date Changes

    You're welcome.

    Please mark the thread as Solved if you consider it to be so (click on Thread Tools above your first post).

    Also, you can pass on thanks more directly to a contributor by clicking on the "star" icon in the bottom left corner of any post you have found to be helpful.

    Pete

  7. #7
    Registered User
    Join Date
    12-04-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Weekly Date Changes

    Thanks for the feedback. I was about to close this thread when I realized I have another dilemma.

    How can I code this to save the excel file as a new file with a new name that would also change weekly ("12.3.12_12.7.12.xlsm" one week, then "12.10.12_12.14.12.xlsm" for the next week, for example)?

    Again, any help is much appreciated

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Weekly Date Changes

    I don't do much programming these days, so I'm a bit rusty, but I do see threads asking for that kind of thing quite frequently - maybe you can search for them.

    Pete

  9. #9
    Registered User
    Join Date
    12-04-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Weekly Date Changes

    I'll mark as solved for now and do some research. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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