+ Reply to Thread
Results 1 to 8 of 8

Check box selection for sheet printing

  1. #1
    Registered User
    Join Date
    11-10-2015
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    4

    Check box selection for sheet printing

    Hi

    I'm looking to add a front sheet to my parts workbook that will allow checkbox selection of the sheets to be printed when command button is pressed. The workbook has approximately 190 sheets so ctrl select becomes a pain!

    In my naivety I assumed that a command button that has the following would work:

    Please Login or Register  to view this content.
    Clearly not as it does nothing! I'm new to the programming as you may guess! Any help gratefully received.
    Last edited by SimonDann; 11-10-2015 at 10:03 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: Check box selection for sheet printing

    As you not declared b2, b4 or b6 these are treated as Variant variables (not addresses as you could suppose)

    Try:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Check box selection for sheet printing

    Hi, welcome to the forum.
    Let me point out that it is important to include the version of Excel you're using.
    I suggest you just list all the worksheets in several columns in such a way that it's readable.
    You could add a right-click event to do what you want.
    The idea:
    Select the cell with the worksheet name, right click and then print it.
    The macro would be to print the selected sheet name:

    Sheets(< target.value>).Printout
    You will have to take care of the page lay-out and so.

    Please Login or Register  to view this content.
    The above code should work if you have a worksheet with all the names

    Just place this code in the sheet's VBA
    enter a sheet name in any cell let's say B2
    Then right-click B2 and it should work
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  4. #4
    Registered User
    Join Date
    11-10-2015
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    4

    Re: Check box selection for sheet printing

    Many thanks to you both. With your help I've got to the point where I've created a trial file with the cover sheet like this:
    Trial1.jpg

    The code is:
    Please Login or Register  to view this content.
    Works a treat.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Check box selection for sheet printing

    Yes, looks good, but what are going to do about the other 186 sheets ?

  6. #6
    Registered User
    Join Date
    11-10-2015
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    4

    Re: Check box selection for sheet printing

    Sheets are selected based on job requirements. The final version will have dropdown box selection as well as check box's. It will cover all of the workbook sheets but normally only about 15-20 are needed each time. The trail above was just to prove the coding.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Check box selection for sheet printing

    And how do you plan to select these 15-20 sheets?

  8. #8
    Registered User
    Join Date
    11-10-2015
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    4

    Re: Check box selection for sheet printing

    From a mixture of drop down box's and check box's, as I said above!

+ 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. Printing each filter selection
    By neofox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2015, 07:00 AM
  2. [SOLVED] VBA help password check then open form or sheet depending on option button selection
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2013, 06:35 AM
  3. Replies: 0
    Last Post: 07-18-2012, 03:57 AM
  4. Disabling Printing ability of a sheet unless printing from a macro
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2012, 04:41 AM
  5. printing a selection
    By Bart in forum Excel General
    Replies: 1
    Last Post: 06-02-2006, 04:30 PM
  6. Printing a selection of rows
    By Jbucks007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2005, 03:25 AM
  7. how to check if user has made a selection on the sheet
    By chawla12amit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 03:51 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