+ Reply to Thread
Results 1 to 6 of 6

Macro which will select certain tabs to print

  1. #1
    Registered User
    Join Date
    04-16-2008
    Posts
    3

    Macro which will select certain tabs to print

    Hello,

    I am putting together a workbook with multiple tabs and would like a master print page. There are maybe 30 tabs in total and each represents a business unit. Within each tab are macros which run duties to be completed each day, broken into morning and evenings. I need to program a macro that will refer to a MASTER tab in which the users can specify which business units they have.

    Can anyone help me with this? I am fairly good with Macros and VBA, but this one has me stumped. I was thinking of something like a list of the units, and the user enters a character in the cell to the left of the unit and then the macros reads those to know which tabs to print. Not sure how to program that.

    Thank you everyone in advance for any help you might have.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Cineplex,

    Welcome to the Forum!

    Add a UserForm to your project. Place a ListBox, and 2 Command Buttons on it. Change the Caption on CommandButton1 to "Cancel", and the caption on CommandButton2 to "Print Sheets". Copy the following code below into the UserForm Declarations section.
    Please Login or Register  to view this content.
    You can add a macro to display the form and call this macro from code or assign it to a button on a worksheet, etc. Place this code in a Standard VBA Moudle.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    This thread was on the exact same topic: http://excelforum.com/showthread.php?t=642080

  4. #4
    Registered User
    Join Date
    04-16-2008
    Posts
    3

    follow-up

    Now beyond this can this code be set to trigger a macro on each of the tabs? I' have attached a stripped down version of this with only one tab to help explain what I am trying to achieve I had added comments in the workbook.

    Thank you again for all the help
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Cineplex,

    You must zip a workbook file before attaching it to your post.

    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    04-16-2008
    Posts
    3
    I zipped as requested, and attached a semi-working version of the workbook. The "add new unit" button does not work as I had to save KB and removed my templated TAB.

    If you look at the Concession Tab you will see that it has a macro for each part of the day. Example: Friday Matinee, Friday Evening, Saturday Matinee, etc etc.

    The code you provided above worked perfectly to print the tabs, my next step is to get it to run a particular macro on each tab.

    As a side note, I would be perfectly happy if I had to have a command button for each day in order for this to work. I'm not looking for a one command button solution as I know that may not be possible.

    I hope that this makes sense,

    I really appreciate the help!
    Attached Files Attached Files
    Last edited by Cineplex; 04-20-2008 at 03:10 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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