Results 1 to 10 of 10

userform listbox

Threaded View

  1. #4
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: userform listbox - copy listbox 2 to cell, then print, multiple times

    The reason i asked about the way that you where populating the list, if you where using an array or other methods this may be an *** about way of doing things.

    Try the other responce, Cheers for cutting my grass. Ill just go back behind my rock. Kidding.

    Dim X As Long
    Dim Listqty As Long
    Range("B1").Clear
        Listqty = ListBox1.ListCount - 1
        For X = 0 To Listqty
            Range("B1").value = ListBox1.List(Listqty)
            ThisWorkbook.Sheets(1).PrintOut
        Next X
    This is a simple loop., The way it works is using a variable to store the number of items that have been populated in the list,this number is retirved be using listbox.listcount. Though rember that the placement of the listbox stars at 0 and not 1. Thats why the varaible is -1 and the loop starts at 0.
    Then its just a matter of changing the cell.value and using the printout function to print the sheet.
    Last edited by D_Rennie; 02-14-2013 at 03:21 AM. Reason: optional

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