+ Reply to Thread
Results 1 to 6 of 6

Print Worksheet(s) from selection on Drop Down

  1. #1
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Print Worksheet(s) from selection on Drop Down

    I have a drop down in sheetQUOTE that selects rows from sheetSUMMARY- ( each row in sheetSUMMARY is the grand totals from a separate specific worksheet.)

    Thanks to NBVC and Dean England for their help with the drop down.

    MY ISSUE:
    After sheetQUOTE is completed I would like a command button to push and
    print

    a) sheetQUOTE
    b) each worksheet that is represented by a selection from the drop down.

    I added a column in sheetSUMMARY and entered the worsksheet name for each row. I can get it selected in the drop down, but no success after that.

    AND it would be great to have another command button to do same basic thing, except to save as one pdf (a) sheetQUOTE and each worksheet represented by a selection in the dropdown)

    I have attached a scaled down XLs, just deleted all the detail on each worksheet- but grand totals still link to sheetSUMMARY

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937
    Attach the following procedure to a command button:

    Please Login or Register  to view this content.
    Note: A couple of tab names had extra spaces at the end which made the actual tab names different from the names in the list on the SUMMARY sheet. Also, the empty cells in the "Items" column on the QUOTE sheet had blank spaces and were not actually empty causing problems for the procedure as written. It does work and should get you started.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    I get an error messge when I run this

    proton Leah,

    thanks. It looks exactly like what I need.


    When I run the macro, I get an errror:

    "Run Time error '9' Subscript out of range"-

    and debugger yellow highlights "ReDim Preserve PrintList(SheetCount)"


    I removed the blank spaces at end of the 2 sheet names and used Clear Contents on the blank cells in the "# Units" column. I have attached another copy of the cleaned up workbook with your macro, so you can see what it is doing.

    As part of this, also need the macro to print: Worksheet(A. INDIVIDUAL PRODUCTS) if on Sheet(QUOTE) C:E33 > 0-- that is a worksheet that is not listed on sheet(SUMMARY) but that might have

    Question: if the cells in "# Units" column have to be empty for this macro to work, will I have to force users to use "Clear Contents" or backspace out any entry-- or is there some other way to get what appears to be a blank cell into the empty state your macro will need?
    Attached Files Attached Files
    Last edited by johnnywinter; 08-26-2007 at 12:35 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937
    I have modified the code as indicated. I tested it with and without entries in QUOTE sheet row 33. I also changed the test to account for blanks/spaces in the items column (the # Units was not part of the test). Hope this one works o.k.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Only 1 more issue.

    protonLeah, works really great. Thank you.

    After everything is printed, ends up on the first sheet that listed in the rows on sheetQUOTES and leaves all the worksheets that were printed as activated (tabs highlighted).

    I got it to return to sheetQUOTES by inserting:
    "Worksheets("QUOTE").activate" as last line of your macro.

    But, I do not know how to end up with sheet("QUOTES") being the only sheet activated.

    Thanks again,

  6. #6
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    It is working.

    I got it working,

    just changed: "Worksheets("QUOTE").activate"

    to: "Worksheets("QUOTE").select"

    Again, thanks for all the help.

+ 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