+ Reply to Thread
Results 1 to 2 of 2

Exit Sub if macro is ran with a certain range selected

  1. #1
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Exit Sub if macro is ran with a certain range selected

    I have this button that reverts the format back to how is should be once it is altered. The format that it corrects is in a specific range and if the selection is anywhere else on the spreadsheet, I need to make sure that the macro doesnt run, but I'm not getting it to work after trying different methods. Any help is appreciated.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Exit Sub if macro is ran with a certain range selected

    Try this macro. Change the range (in red) to suit your needs. Place your code where indicated.
    Please Login or Register  to view this content.
    Last edited by Mumps1; 05-12-2020 at 01:26 PM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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. [SOLVED] Macro to copy cells from a selected range and just paste values back to that same range
    By catscats11 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2019, 02:59 PM
  2. [SOLVED] Disable exit on selected tabs
    By RANDY LIPOSKY in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2015, 01:53 AM
  3. Exit macro when no file is selected for open
    By fblaze in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2014, 04:08 PM
  4. Exit sub if even row selected in specific column
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2014, 02:09 PM
  5. When Cancel is selected, I want to exit sub
    By Rubert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 05:02 PM
  6. [SOLVED] How to set range within a macro based on what range is selected on the worksheet
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2013, 12:49 PM
  7. Auto save on exit selected data sheets, instead of whole project?
    By Bafa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-09-2008, 01:38 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