Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
Here is what I am trying to do.
I have a worksheet named Vendor List Cells D4 to D33 contain the data Now I want to create a userform (i know how to do that) with a list box (know how to do that) but what I can not figure out is how to get that D4 to D33 data into the listbox for the user to select. Valadation is no good in this instance because I want to be able to insert the users selection in different worksheets. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
You can copy this event in the Userform mudule to fill your listbox
Private Sub UserForm_Initialize() ListBox1.List = Sheets("Sheet1").Range("d4:d33").Value End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "P Dudesek" wrote in message ... Here is what I am trying to do. I have a worksheet named Vendor List Cells D4 to D33 contain the data Now I want to create a userform (i know how to do that) with a list box (know how to do that) but what I can not figure out is how to get that D4 to D33 data into the listbox for the user to select. Valadation is no good in this instance because I want to be able to insert the users selection in different worksheets. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
mudule ..module
-- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ron de Bruin" wrote in message ... You can copy this event in the Userform mudule to fill your listbox Private Sub UserForm_Initialize() ListBox1.List = Sheets("Sheet1").Range("d4:d33").Value End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "P Dudesek" wrote in message ... Here is what I am trying to do. I have a worksheet named Vendor List Cells D4 to D33 contain the data Now I want to create a userform (i know how to do that) with a list box (know how to do that) but what I can not figure out is how to get that D4 to D33 data into the listbox for the user to select. Valadation is no good in this instance because I want to be able to insert the users selection in different worksheets. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
Set the Rowsource property of the listbox on the userform to the
following..... (Change the sheet to the one with the list data) Sheet1!D43:D33 Alternatively programmatically fill the list box by use the .additem method and reading the data range. This method is more elegant and allows the range to expand and contract as controlled by the range definition in your programme. Cheers N. "P Dudesek" wrote in message ... Here is what I am trying to do. I have a worksheet named Vendor List Cells D4 to D33 contain the data Now I want to create a userform (i know how to do that) with a list box (know how to do that) but what I can not figure out is how to get that D4 to D33 data into the listbox for the user to select. Valadation is no good in this instance because I want to be able to insert the users selection in different worksheets. Thanks ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
Alternatively programmatically fill the list box by use the .additem method
and reading the data range. Using the ListBox's list method is quicker i.e. ListBox1.List = Range("D4:D33").Value -- "Nigel" wrote in message ... Set the Rowsource property of the listbox on the userform to the following..... (Change the sheet to the one with the list data) Sheet1!D43:D33 Alternatively programmatically fill the list box by use the .additem method and reading the data range. This method is more elegant and allows the range to expand and contract as controlled by the range definition in your programme. Cheers N. "P Dudesek" wrote in message ... Here is what I am trying to do. I have a worksheet named Vendor List Cells D4 to D33 contain the data Now I want to create a userform (i know how to do that) with a list box (know how to do that) but what I can not figure out is how to get that D4 to D33 data into the listbox for the user to select. Valadation is no good in this instance because I want to be able to insert the users selection in different worksheets. Thanks ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting list box contents
Thanks Ron, That is what I have been trying to do. I am trying to learn
this by myself. But that had me stumped. "Ron de Bruin" wrote in news:#P5rYERtDHA.640 @tk2msftngp13.phx.gbl: You can copy this event in the Userform mudule to fill your listbox Private Sub UserForm_Initialize() ListBox1.List = Sheets("Sheet1").Range("d4:d33").Value End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Validation "List" - Setting length of list shown | Excel Discussion (Misc queries) | |||
TAB as list separator via regional setting | Excel Discussion (Misc queries) | |||
Setting up a price list | Excel Worksheet Functions | |||
List box - setting default selection | Excel Discussion (Misc queries) | |||
Setting up a random list from long list of names ? | Excel Discussion (Misc queries) |