+ Reply to Thread
Results 1 to 5 of 5

schedule a code to run once a week

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    schedule a code to run once a week

    Hello forum,
    I found this code in a different forum where it is scheduled to run once a month:
    Please Login or Register  to view this content.
    i love this code because it stores the last run date in some inner library so that if the day was missed it will still run the next time the workbook is opened, but i don't know how to make this code run once a week. I can get it to run once a day because excel recognizes the code word "Day", but excel will not recognize the word "Week".
    Any help on this would be greatly appreciated.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: schedule a code to run once a week

    Hi,

    The date last run is stored in 'Custom Document Properties' in your file. Each Excel file has 'Built In' Document Properties and 'Custom' Document Properties.

    To access 'Built In Document Properties':
    Excel 2003: File > Properties > Summary
    Excel 2010: File > Info > Properties > Advanced Properties > Summary


    To access 'Custom Document Properties':
    Excel 2003: File > Properties > Custom
    Excel 2010: File > Info > Properties > Advanced Properties > Custom

    Try the following modified version of your Macro:
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: schedule a code to run once a week

    Hi Lewis,
    Thanks for explaining to me how the code works, it's very much appreciated.
    The code ran the first time and worked!, now all i have to do is wait a week and see if it runs a second time
    It looks good so far.
    Thank you again Lewis, all the best to you

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: schedule a code to run once a week

    My pleasure to help and thanks for the rep points.

    You can test the code without waiting a week. Go to the custom property and edit the date. If you change the date to March 2 it should not run. If you change the date to March 1 it should run.

    You can temporarily comment out your macro if you don't want your macro to run again today.

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: schedule a code to run once a week

    Great idea!
    It worked!
    Thanks again.

+ 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. How do I create a rotating roster for a 10 week on 2 week off schedule
    By MacknMeggs78 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-02-2014, 09:18 PM
  2. Setting up Schedule to start on Monday for every Week
    By mattyp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2014, 02:15 PM
  3. [SOLVED] Calculate total hours per week per schedule
    By rizmomin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-14-2013, 11:28 PM
  4. Replies: 1
    Last Post: 05-14-2013, 09:35 AM
  5. Transform monthly schedule to week basis
    By Esprimo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-19-2013, 09:04 AM
  6. 6 day schedule on a 5 day work week
    By bthomson in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-14-2011, 06:06 PM
  7. Replies: 0
    Last Post: 06-16-2005, 07:05 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