+ Reply to Thread
Results 1 to 5 of 5

Run same macro on multiple sheets but not every sheet

  1. #1
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Run same macro on multiple sheets but not every sheet

    I would like to run a small VBA macro on several sheets in a workbook, but not all sheets.

    I have found this code works for all worksheets but I do not want every sheet included:
    ANy ideas?
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Run same macro on multiple sheets but not every sheet

    Change Name1 and Name2 to the sheets you don't want to run the code.
    you can add more sheets like And xSh.Name <> "Name3"......
    Please Login or Register  to view this content.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Run same macro on multiple sheets but not every sheet

    Thank you. That helped.

  4. #4
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Run same macro on multiple sheets but not every sheet

    Thanks for the feedback.

  5. #5
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Run same macro on multiple sheets but not every sheet

    I also did some further searching and found this. It works by including the sheets rather than excluding them. I realized I needed this approach as I will add sheets in the future I do not want to be effected by the macro.

    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)

Similar Threads

  1. Macro - To copy rows from multiple sheets to one sheet
    By MacroNovice2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2019, 10:45 AM
  2. [SOLVED] Copy data from multiple sheets to one sheet macro
    By sinapourazima in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2014, 12:49 AM
  3. [SOLVED] Need Macro to combine columns from multiple sheets together in a new sheet
    By hroush22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2014, 07:12 AM
  4. Macro to Extract Data from Multiple Sheets into One Sheet
    By BillW93 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2013, 10:55 AM
  5. Replies: 7
    Last Post: 10-19-2011, 08:33 AM
  6. Macro to Copy Data from One Sheet onto Multiple Sheets
    By ssteines in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-03-2011, 05:50 PM
  7. Macro - copy value only from multiple sheets into one sheet
    By yangfang in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2010, 05:09 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