+ Reply to Thread
Results 1 to 9 of 9

how to exit macro if workbook saved

  1. #1
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    how to exit macro if workbook saved

    hi to all you excel gods
    i have some code that makes a range of cells flash but would like it stop flashing if the workbook is saved "exit the Macro" i have tried numerous whys of try to get this to work with no joy i know i need something like thisworkbook.save then exit sub this doesnt work here my code

    Please Login or Register  to view this content.

    thanks in advance

    shane

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: how to exit macro if workbook saved

    You could try using a cheater cell. The cell can be any cell you don't use and can hide.

    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    Re: how to exit macro if workbook saved

    hi thanks where do i put this part of the code :

    Please Login or Register  to view this content.
    cheers
    shane

  4. #4
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    Re: how to exit macro if workbook saved

    Quote Originally Posted by sspreyer View Post
    hi thanks where do i put this part of the code :

    Please Login or Register  to view this content.
    cheers
    shane
    me being a bit slow worked out sorry

    thanks

  5. #5
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    Re: how to exit macro if workbook saved

    hi
    im getting subscript out of range "9" here my code
    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    Re: how to exit macro if workbook saved

    hi
    right i got the code to work with no errors but still does not stop the cells from flashing when saving i found it actually restarts the macro

    cheers

    shane
    Last edited by sspreyer; 10-25-2013 at 02:24 PM.

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: how to exit macro if workbook saved

    You have several loops going there. I keep losing track Try putting
    Please Login or Register  to view this content.
    on the final loop



    e/
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 10-25-2013 at 02:31 PM. Reason: added arrow

  8. #8
    Forum Contributor sspreyer's Avatar
    Join Date
    07-05-2013
    Location
    london
    MS-Off Ver
    Excel 365 enterprise
    Posts
    191

    Re: how to exit macro if workbook saved

    hi
    still not working when i save the work book it retriggers the macro and cell starts flashing to make it abit easier i have attached workbook to show
    Cmm Tracker test.xlsm

    cheers

    shane

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: how to exit macro if workbook saved

    Thats because you're calling the flashback sub in the worksheet change event. Its going to start flashing every time you change anything.


    e/ You can disable events using the aftersave event, but none of your event triggered macros will work again until you enable events.

+ 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. Macro to exit all workbook leaving one specific workbook open
    By Khanzaki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2013, 05:09 AM
  2. [SOLVED] Run macro on exit worksheet/workbook
    By toontje in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. [SOLVED] Run macro on exit worksheet/workbook
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 04:05 AM
  4. Run macro on exit worksheet/workbook
    By toontje in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. [SOLVED] Run macro on exit worksheet/workbook
    By toontje in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11: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