+ Reply to Thread
Results 1 to 4 of 4

Macro Help - Trying to apply macro to multiple tabs

  1. #1
    Registered User
    Join Date
    12-30-2010
    Location
    Vienna VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macro Help - Trying to apply macro to multiple tabs

    In the macro I am creating, I am trying to collapse each tab's groupings to show Outline 1 and then to print all of the selected tabs. I will be creating a print macro button for the users, so I want it to be able to run from the first tab. However, it runs the macro only on the active sheet. Is there a way to modify the coding? See below.

    Please Login or Register  to view this content.
    Thanks! -Colleen
    Last edited by DonkeyOte; 12-30-2010 at 12:13 PM. Reason: added code tags

  2. #2
    Registered User
    Join Date
    05-22-2008
    Posts
    74

    Re: Macro Help - Trying to apply macro to multiple tabs

    Hi Colleen,

    from what I see you could reduce this code a lot by just addressing the sheet that you want rather than "scrolling" each time. Just address the sheet you want. go into the developer tab and open VBA. Go to the Module and edit your macro there. I don't know if you are just recording a macro until it works, or if you use VBA editor after you record a macro.

    Please Login or Register  to view this content.
    'etc. you don't need all those scrolls. Finally in the end you have

    Please Login or Register  to view this content.
    'Try removing this next "Activate." I'm not familiar with the above statement. It appears that it is selecting all the sheets you want printed after having collapsed the rows to the proper level. But if you went through and selected all the sheets then you activated (or selected) a new sheet. It seems like you will lose the array selection, and only the active sheet will print.
    [/code]
    Please Login or Register  to view this content.
    See if that helps.
    Last edited by scottintexas; 12-30-2010 at 12:13 PM. Reason: Added some clarification
    Scott
    The harder it gets the happier I am.
    Finally got my signature set up!

  3. #3
    Registered User
    Join Date
    12-30-2010
    Location
    Vienna VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro Help - Trying to apply macro to multiple tabs

    But I want each of those sheets to collapse to the first level, therefore I have to go to each sheet and collapse the grouping to Level 1. I dont want the user to print the workbook showing levels 2 - 5, but I want them to be able to view levels 2 - 5 when they are using it.

  4. #4
    Registered User
    Join Date
    12-30-2010
    Location
    Vienna VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro Help - Trying to apply macro to multiple tabs

    I was able to solve the problem with the help of someone at work. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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