Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm ListBox problem
Can any one give me the secret to entering a RowSource for a ListBox on a
UserForm? What I want to use is Supervisors!W4:W24 I get an Invalid Property Value |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm ListBox problem
Just happen to be doing this myself.... you need to highlight your
source and name the selection.. (next to the formular bar is the name bar) (call it YOURVALUES or something like that) then once it's a named source you can change the value of your listbox source input range to =YOURVALUES (or whatever you named it) On Feb 25, 1:35 pm, "Patrick C. Simonds" wrote: Can any one give me the secret to entering a RowSource for a ListBox on a UserForm? What I want to use is Supervisors!W4:W24 I get an Invalid Property Value |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm ListBox problem
try this. paste it in the code of the userform. it will list all cells in w
down. u can sellect more than one option in the listbox Private Sub UserForm_Initialize() Dim myRng As Range With Worksheets("supervisors") Set myRng = .Range("W4", .Cells(.Rows.Count, "c").End(xlUp)) End With With Me.ListBox1 .MultiSelect = fmMultiSelectMulti .ListStyle = fmListStyleOption .List = myRng.Value End With "Patrick C. Simonds" wrote: Can any one give me the secret to entering a RowSource for a ListBox on a UserForm? What I want to use is Supervisors!W4:W24 I get an Invalid Property Value |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm ListBox problem
If your ListBox is on a UserForm:
1) In the Properties window of the Visual Basic Editor, with the ListBox having focus, enter Supervisors!w4:w24 on the line provided for Row Source. 2) Using VBA code in the general code module assuming UserForm1: UserForm1.ListBox1.RowSource = "Supervisors!w4:w24" 3) Using VBA code in the UserForm Initialize event" ListBox1.RowSource = "Supervisors!w4:w24" I'm not sure if it is case sensitive or not for the sheet name, but it doesn't hurt to be sure that it is the same. In the Properties box without quotes, in code with quotes. "Patrick C. Simonds" wrote: Can any one give me the secret to entering a RowSource for a ListBox on a UserForm? What I want to use is Supervisors!W4:W24 I get an Invalid Property Value |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm ListBox problem
Using .list is different from using .rowsource. (And I bet you didn't mean to
use column C in the line that sets myrng to the range: Option Explicit Private Sub UserForm_Initialize() Dim myRng As Range With Worksheets("supervisors") Set myRng = .Range("W4", .Cells(.Rows.Count, "W").End(xlUp)) 'or set myrng = .range("w4:w24") '??? End With With Me.ListBox1 .MultiSelect = fmMultiSelectMulti 'maybe??? .ListStyle = fmListStyleOption .rowsource = myrng.address(external:=true) End With .... pswanie wrote: try this. paste it in the code of the userform. it will list all cells in w down. u can sellect more than one option in the listbox Private Sub UserForm_Initialize() Dim myRng As Range With Worksheets("supervisors") Set myRng = .Range("W4", .Cells(.Rows.Count, "c").End(xlUp)) End With With Me.ListBox1 .MultiSelect = fmMultiSelectMulti .ListStyle = fmListStyleOption .List = myRng.Value End With "Patrick C. Simonds" wrote: Can any one give me the secret to entering a RowSource for a ListBox on a UserForm? What I want to use is Supervisors!W4:W24 I get an Invalid Property Value -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm & listBox | Excel Programming | |||
on Listbox in Userform.... | Excel Programming | |||
userform multiselect listbox problem | Excel Programming | |||
userform listbox cannot get listbox.value to transfer back to main sub | Excel Programming | |||
UserForm Listbox in VBC | Excel Discussion (Misc queries) |