+ Reply to Thread
Results 1 to 6 of 6

Executing macro only once on open

Hybrid View

  1. #1
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Executing macro only once on open

    Yes, just run the code if today's date is not in the cell.......

  2. #2
    Registered User
    Join Date
    05-22-2018
    Location
    Bryn Mawr, Pennsylvania
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Executing macro only once on open

    if the macro is run today and 5/22/2018 is in the cell, then the file opened tomorrow (5/23) will the macro run? Our Finance department will open the file and use it multiple times.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Executing macro only once on open

    If you want it only to run once, when the workbook is opened, it will check if the cell has today date in it, if not, then it will run the code, and place the date in the cell, so that next time the wb is opened, if first checks the date of the cell to see if it has to run the code or not.

+ 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. auto open macro not executing
    By wagner1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2015, 02:55 PM
  2. [SOLVED] executing macro causes excel to open the workbook that the macro is associated with
    By YOO629 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2015, 11:18 PM
  3. [SOLVED] Executing a SaveAs Command in an Open .txt File
    By HannahTee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2013, 10:57 PM
  4. Disable Workbook Open Event Until Other Code has finished Executing
    By dgdgdg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2013, 05:36 AM
  5. [SOLVED] Macro stops executing if another workbook is open
    By 4evra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2013, 12:32 PM
  6. When executing macro via hyperlink, macro doesn't re-scroll window back to A1
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-15-2011, 02:30 PM
  7. Open file after workbook executing code is closed
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2011, 10: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