+ Reply to Thread
Results 1 to 7 of 7

Want code to run on all sheets except one, but it is only running on active sheet.

  1. #1
    Registered User
    Join Date
    11-28-2017
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    9

    Want code to run on all sheets except one, but it is only running on active sheet.

    Hello VBA gurus!
    I am pretty new to VBA and I am in need of help with a code in VBA that I want to be executed on all sheets in the workbook except the sheet called "Total". I further want the results from each sheet to be "printed" in the "Total" sheet. Right now, the code is only running on the active sheet, as well as it is printing the same value into all of the cells in the "Total" sheet. The different sheets have different amounts of values, and I want to use the code in several workbooks, and therefore I do not know the name of all the sheets except the "Total" sheet.

    I would appreciate any help to make my code run properly, thank you in advance!
    The code so far looks like this:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Change:

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    11-28-2017
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    9

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Thank you for replying, but I have tried that - and unfortunately it did not work

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Maybe:

    Please Login or Register  to view this content.
    Last edited by xladept; 11-28-2017 at 02:39 PM.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  6. #6
    Registered User
    Join Date
    11-28-2017
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    9

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Thank you xladept, but the code is still not working - it keeps implementing the filters on the active sheet (also the "Total" sheet).

  7. #7
    Registered User
    Join Date
    11-28-2017
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    9

    Re: Want code to run on all sheets except one, but it is only running on active sheet.

    Thank you for your suggestion mehmetcik, but it does not seem to work.. It is as all the other codes implementing the code on the active sheet, and not all of the sheets in the workbook except the "total" sheet.

+ 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. Vba delete all sheets except active sheet and specified sheets
    By lukerhodes11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2017, 04:32 PM
  2. Active Workbooks Displayed before Running Macro Code?
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2014, 10:41 AM
  3. [SOLVED] Running Macro from another sheet but referring to Active Worksheet
    By RUTrading in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2014, 06:27 PM
  4. Code for makro running automatic every .... minutes (if active)
    By kanopat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2014, 10:57 AM
  5. [SOLVED] Active Sheet not automatically running macro
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2014, 06:54 AM
  6. Enter key moves active cell unexpectedly after running code
    By GCW esq in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-26-2011, 04:43 AM
  7. Running code in one open workbook another active
    By shumba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2010, 04:20 AM

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