+ Reply to Thread
Results 1 to 5 of 5

Don't run macro if multiple cells selected

  1. #1
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Don't run macro if multiple cells selected

    Hello everyone,

    Does anyone know how can we avoid the macro to run - the ones that are triggered by buttons and active cells - if multiple cells are selected?

    Never thought about it before, but i accidentally clicked in one of the buttons when the whole column was selected, and I would like to avoid situations like this.

    Best regards.

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

    Re: Don't run macro if multiple cells selected

    What's the code you are using?

  3. #3
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Re: Don't run macro if multiple cells selected

    My idea was to apply it to all the codes i have which use activecells and buttons.

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

    Re: Don't run macro if multiple cells selected

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Re: Don't run macro if multiple cells selected

    Thank you.

    Added an exit sub after the second msgbox but that was what I had in mind.

    Much obliged

+ 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. Is there a Macro that can insert multiple photos to a selected range of cells.
    By ebridge in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2016, 04:12 PM
  2. Replies: 0
    Last Post: 02-09-2015, 03:37 PM
  3. [SOLVED] Please I need a macro to delete duplicate cells in a several selected cells in Excel?
    By amkoloui in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-15-2014, 02:17 PM
  4. Replies: 6
    Last Post: 08-09-2013, 06:20 PM
  5. how to fix multiple cells being selected at once
    By skyeler in forum Excel General
    Replies: 1
    Last Post: 11-08-2011, 10:16 AM
  6. Replies: 2
    Last Post: 08-28-2011, 02:39 AM
  7. Macro to take selected cells times a selected cell
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2005, 08:05 PM

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