+ Reply to Thread
Results 1 to 4 of 4

Auto open only once?

  1. #1
    Registered User
    Join Date
    08-13-2010
    Location
    Madison, WI
    MS-Off Ver
    Excel 2003
    Posts
    2

    Auto open only once?

    I have a macro that needs to automatically run the first time my workbook is opened (the first time after the macro is created and the file is saved/closed, obviously), then never run again (not automatically, any way). Is there any way to accomplish this?

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Auto open only once?

    Perhaps put a number in a sheet somewhere when run and add a check on whether number is present? e.g. if A1=1 then already run so don't run again.

  3. #3
    Registered User
    Join Date
    08-13-2010
    Location
    Madison, WI
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Auto open only once?

    Steven, I thought of that, but how do I tell it to not run again? Right now it's auto running because I named the macro auto_open.

    Quote Originally Posted by StephenR View Post
    Perhaps put a number in a sheet somewhere when run and add a check on whether number is present? e.g. if A1=1 then already run so don't run again.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Auto open only once?

    Instead of auto_open, why not put the code in the Workbook_Open event (in the ThisWorkbook module) and then you can add a line at the beginning, if a1=1 then exit the sub.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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