+ Reply to Thread
Results 1 to 12 of 12

printing userform listbox

Hybrid View

  1. #1
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    printing userform listbox

    I have a userform with frame and a listbox in a frame. Listbox is higher than a frame so a frame has a scroll bar.
    How can I print the whole listbox with all items?

    The code UserForm.PrintForm will print just the 'visible' part of listbox, but not the rest of it which is hidden in the frame

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: printing userform listbox

    As you say the userform print method only prints what is visible on the userform.

    So to use that method you will need to make the form/listbox bigger.

    The normal approach is to use a worksheet, which you populate with information, for printing.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: printing userform listbox

    unfortunatelly, my boss likes the listbox and dislikes the workshhet.

    I can't make listbox ie. frame bigger, because listbox is very high (more than 2000) and it doesn't look nice, and it also doesn't fit on the screen, so again, I would get only what is seen on the screen, but not everything "below" the screen

    Is there some way, perhaps with listindex or something, so I can determine how many items are there and print them?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: printing userform listbox

    unfortunatelly, my boss likes the listbox and dislikes the workshhet.
    It's printed output you are creating, how would your boss know or care if a worksheet was used as way of making the printout readable?

    So you have a listbox with +2000 items. Which of those items should be in the print out?

    the properties
    ListCount - how many items in list
    ListIndex - currently selected item, zero based and single selection
    TopIndex - item number of first visible row

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: printing userform listbox

    One huge Listbox with 2000 lines, the list would span many sheets any way
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: printing userform listbox

    All items in listbox should be printed.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: printing userform listbox

    The only sensible way is to print the list from which the ListBox is populated

  8. #8
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: printing userform listbox

    I have another problem.

    I have one listbox with items, and with a command button I transfer selected items to another listbox.
    How can I now selected items from second listbox transfer to worksheet?

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: printing userform listbox

    Start another thread.
    Explain the problem and post example file, as your current question does not make much sense to those who do not know your project inside out.

  10. #10
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: printing userform listbox

    I have a userform with a listbox and several command buttons and labels.

    Is it possible to print just the listbox?

    If I use UserForm.PrintForm it prints all the 'objects' on the userform. Is it possibe to print just selected 'objects' on that userform, for example just the listbox?

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: printing userform listbox

    Quote Originally Posted by cassiopea View Post
    I have a userform with a listbox and several command buttons and labels.

    Is it possible to print just the listbox?

    If I use UserForm.PrintForm it prints all the 'objects' on the userform. Is it possibe to print just selected 'objects' on that userform, for example just the listbox?

    Isn't this what we just answered above?

+ 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