+ Reply to Thread
Results 1 to 8 of 8

VBA - Print worksheets Selection from a defined list.

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    Essex
    MS-Off Ver
    Excel 2013
    Posts
    21

    VBA - Print worksheets Selection from a defined list.

    Hi,

    I have a large workbook 800+ Sheets and I need to print a selction of the 800 sheets, they are in a random order within the workbook so I cannnot easliy selected each sheet. I have a control sheet that is linked to each sheet by its sheet name I can filter the control sheet to select the 250 sheets that I need.
    So is there a way that I could for example copy and paste the sheet names into a new sheet callec "print selection" and then use VBA to loop through the list to print each sheet.

    the code would also need to adjust the print options to 1.) narrow margins, 2.) Fit all coulmns across one page.

    Best Regards

    Mark

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA - Print worksheets Selection from a defined list.

    I don't think you would need to copy and paste the sheet names to a new sheet and instead could just loop through the filtered range on the control sheet and print out based upon that. With regards to the narrow margins and Fit all columns you could just use the Macro Recorder to get the code. To give a direct answer I would need to examine the layout of the control sheet.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Registered User
    Join Date
    12-02-2013
    Location
    Essex
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: VBA - Print worksheets Selection from a defined list.

    Hi Stnkynts

    Thanks for your reply, sorry it has taken so long to get back to you, my work book is quite large so I have attached a smaller version with a control sheet and a selction of worksheets.
    let me know if you need any more information.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA - Print worksheets Selection from a defined list.

    What about the sheet names on the control.sheet determines whether they get printed out or not.

  5. #5
    Registered User
    Join Date
    12-02-2013
    Location
    Essex
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: VBA - Print worksheets Selection from a defined list.

    Hi,

    New worksheets are created by VBA and the row in the control is created at the same time with links to the stock card "Worksheets" the product code "Sheet Name" is created in Cell E3 this is the same for all worksheets. I have a piece of VBA that changes the sheet name to match the entry in E3 of that Stock Card.
    So unless a link is broken the entries in column C will match each Stock card exactly.
    I would like to identify the list of sheets that need printing by filtering column B (their Stock location) so for example only print the "HARTRD" Stock cards, would print the 8 HARTRD stock cards Worksheets that are in the Sample workbook.

    I hope this Helps & Thanks again for your time.

    Best Regards

    Mark

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA - Print worksheets Selection from a defined list.

    I still don't think you answered my question so I will make some assumptions. One of those is that you self filter for the values you want in column B.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-02-2013
    Location
    Essex
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: VBA - Print worksheets Selection from a defined list.

    Thanks Stnkynts

    your code works a treat. but could you offer some advice as to where to add the print preferences into the code. I have used the Macro recorder and have the follwing Code

    Please Login or Register  to view this content.
    Sorry to be a pain and thanks again for your help.

    Best Regards

    Mark

  8. #8
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA - Print worksheets Selection from a defined list.

    Maybe this. Not sure though

    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. Print each drop-down list selection
    By Corey in forum Excel General
    Replies: 2
    Last Post: 10-31-2019, 06:23 AM
  2. [SOLVED] Macro that will loop through a filtered list and print each selection
    By bobbysue25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-28-2017, 08:07 AM
  3. Replies: 1
    Last Post: 01-09-2015, 10:43 PM
  4. [SOLVED] Print a Worksheet from a List Box Selection
    By Building in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2014, 07:18 AM
  5. Returning a selection of 3 unique values from a pre-defined list of 9
    By jabbathut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2013, 05:33 PM
  6. Use list to select worksheets to print out
    By shovels in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2009, 12:10 PM
  7. Replies: 1
    Last Post: 06-29-2005, 03:05 PM

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