Results 1 to 3 of 3

Populating Two Listboxes with Sheets Based on Cell Value & Printing Their Selection

Threaded View

  1. #1
    Registered User
    Join Date
    07-14-2009
    Location
    Brighton, England
    MS-Off Ver
    Excel 97
    Posts
    49

    Populating Two Listboxes with Sheets Based on Cell Value & Printing Their Selection

    Hello, once again I have hit a brick wall (I seem to do it a lot).

    What I would like to do is have 2 listboxes. In the first listbox I would like the name of all the worksheets which contain the words "elective class: " in cell C7.

    In the second listbox I would like the name of all the worksheets which do not contain the words "elective class: " in C7. I need this only to source from worksheet 7 onwards however.

    The listboxes are called ListBox1 and ListBox2 respectively.

    Also I am using this to print and I have a button which currently selects all the data in the first listbox and another button which prints all the selected data. The code being used for this is:

    Dim iloop As Integer
    For iloop = 1 To ListBox1.ListCount
     If ListBox1.Selected(iloop - 1) = True Then
       Sheets(ListBox1.List(iloop - 1, 0)).PrintOut
       ListBox1.Selected(iloop - 1) = False
     End If
     Next
    What would I need to change this to to print anything selected in either listbox?

    Finally out of interest since I am doing all of this to learn more than anything, is there a way to define which printer to print to so that even if the default printer is for example a non-colour one. Pressing a button saying perhaps "print colour" would always print to the colour printer?

    Thanks always,

    Tom
    Last edited by TBrooker; 08-14-2009 at 03:48 AM.

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