+ Reply to Thread
Results 1 to 2 of 2

Print only selected sheets from listbox

Hybrid View

  1. #1
    Registered User
    Join Date
    04-09-2010
    Location
    Gary, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    1

    Print only selected sheets from listbox

    Hey everyone, a bit stumped here.

    I have a workbook beforeprint sub to load a form that contains a listbox with all the worksheets in the workbook and the user then selects the sheets they want and clicks the print button on the form and the sheets print with the date and sheetname in the header. However I am not sure how to determine which items were selected in the listbox to print.

    I deleted what I had tried, but with pseudo code it was similar to this:
    for x to totalsheets
    if lstsheets.selected(x) then
    worksheet.header=date & sheetname
    worksheet.print
    end if
    next

    Could someone help me out with this? It would be much appreciated!

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Print only selected sheets from listbox

    Your pseudo code looks pretty good, why don't you post your actual code?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ 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