Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm & listBox jean Excel Programming 5 September 28th 07 12:26 AM
on Listbox in Userform.... x taol Excel Programming 7 October 4th 06 11:29 AM
userform multiselect listbox problem apndas[_7_] Excel Programming 4 July 25th 06 04:12 AM
userform listbox cannot get listbox.value to transfer back to main sub [email protected] Excel Programming 1 May 17th 06 09:44 PM
UserForm Listbox in VBC Marcia3641 Excel Discussion (Misc queries) 7 July 22nd 05 10:20 AM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"