Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a userform that allows users to select and print various objects. I am trying to incorporate a listbox that allows the user to select the number of copies desired. I can populate the listbox fairly easily, but when I try to run the print program (or even a test MsgBox) I get an error stating that the value of the variable nCopies is null. How do I set this up so that the variable nCopies gets its value from the list box? Example code is below; the real deal jumps around a bit between several different subs. sub load () ' populates the list box Dim num As Integer For num = 1 To 25 Form1.ListBox1.AddItem (num) Next end sub sub printcopy () Dim nCopies as Integer nCopies = Form1.ListBox1.Value for i= 1 to nCopies ActiveSheet.PrintOut next end sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comparing List A to List B and add what's missing from List B | Excel Discussion (Misc queries) | |||
create new list from list A, but with exclusions from a list B | Excel Worksheet Functions | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions |