+ Reply to Thread
Results 1 to 2 of 2

Force the running of a Macro on Spreadhseet exit

  1. #1
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Force the running of a Macro on Spreadhseet exit

    Hey all,

    What is the syntax for forcing a macro to run on exit of a sheet. I have a macro that removes all applied fiters that I wish to force the running of when the spreadhseet is closed. The macro is titled
    Please Login or Register  to view this content.
    Thanks gang!
    Last edited by scaffdog845; 04-17-2012 at 03:14 PM. Reason: Solved
    Click here to read the Forum Rules
    Whatever it is in life you decide to go after, go after with great ferocity.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Force the running of a Macro on Spreadhseet exit

    Hold down the Alt key while pressing F11 on your keyboard to bring up Visual Basic. Double click on This Workbook when Visual Basic Opens. From the first drop down in the right side of VB select Workbook. From the second drop down select Before Close. You can either paste your macro code here or type the name of the macro here and it will run before the workbook closes.

    Please Login or Register  to view this content.

+ 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