Results 1 to 3 of 3

Thread: VBA to run a max of once a day
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jun 2014
    Posts
    205
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default VBA to run a max of once a day

    Hi, I'm looking to have an excel file in my windows startup group and have it run when windows loads.

    But I would like to have the code ONLY run once a day.

    So if the code has already run today don't run it again till it's loaded tomorrow.

    I can add a Power Pivot calculated column and have it list last refresh. Would that help?

    Thanks

  2. #2
    MrExcel MVP shg's Avatar
    Join Date
    May 2008
    Location
    The Great State of Texas
    Posts
    21,612
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    14 Thread(s)

    Default Re: VBA to run a max of once a day

    The code could create a named formula contain the last run date, and not run again until that date passes.

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA to run a max of once a day

    I like to use a hidden 'Settings' tab with this kind of info. I save the current date to a row in this hidden tab the first time the Workbook is open that day, and read the value into a Global variable each time the Workbook opens, to see if I need to run the daily routine again.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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