#1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default RowSource

I have a named range, "CashierList" that I would like to populate a
listbox/combo box when the userform is initialized. When I attempt this the
code crashes with error 380 (Could not set the RowSource property. Invalid
property value). If I insert the code, "Me.listbox1.RowSource =
Range("CashierList")". If I hard-code the range in the list box RowSource
properties, it works fine, but I would rather use the UserForm1_Initialize
event so I can change the RowSource depending on which worksheet is active.

Any guidance would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default RowSource

Try this:

Me.listbox1.RowSource = Range("CashierList").Address.


The row source must equate to A1 format.

"Sam" wrote in message
...
I have a named range, "CashierList" that I would like to populate a
listbox/combo box when the userform is initialized. When I attempt this
the
code crashes with error 380 (Could not set the RowSource property. Invalid
property value). If I insert the code, "Me.listbox1.RowSource =
Range("CashierList")". If I hard-code the range in the list box RowSource
properties, it works fine, but I would rather use the
UserForm1_Initialize
event so I can change the RowSource depending on which worksheet is
active.

Any guidance would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default RowSource

Actually, you could just:

Me.ListBox1.RowSource = "CashierList"

That would make the row source a string value in A1 format.



"Sam" wrote in message
...
I have a named range, "CashierList" that I would like to populate a
listbox/combo box when the userform is initialized. When I attempt this
the
code crashes with error 380 (Could not set the RowSource property. Invalid
property value). If I insert the code, "Me.listbox1.RowSource =
Range("CashierList")". If I hard-code the range in the list box RowSource
properties, it works fine, but I would rather use the
UserForm1_Initialize
event so I can change the RowSource depending on which worksheet is
active.

Any guidance would be appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default RowSource

Me.listbox1.RowSource = "CashierList"

"Sam" wrote:

I have a named range, "CashierList" that I would like to populate a
listbox/combo box when the userform is initialized. When I attempt this the
code crashes with error 380 (Could not set the RowSource property. Invalid
property value). If I insert the code, "Me.listbox1.RowSource =
Range("CashierList")". If I hard-code the range in the list box RowSource
properties, it works fine, but I would rather use the UserForm1_Initialize
event so I can change the RowSource depending on which worksheet is active.

Any guidance would be appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default RowSource

Thanks! Got it....

"JLGWhiz" wrote:

Try this:

Me.listbox1.RowSource = Range("CashierList").Address.


The row source must equate to A1 format.

"Sam" wrote in message
...
I have a named range, "CashierList" that I would like to populate a
listbox/combo box when the userform is initialized. When I attempt this
the
code crashes with error 380 (Could not set the RowSource property. Invalid
property value). If I insert the code, "Me.listbox1.RowSource =
Range("CashierList")". If I hard-code the range in the list box RowSource
properties, it works fine, but I would rather use the
UserForm1_Initialize
event so I can change the RowSource depending on which worksheet is
active.

Any guidance would be appreciated.



.

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
Set RowSource ordnance1[_2_] Excel Programming 3 January 6th 10 08:08 PM
RowSource as a row Boba Excel Programming 4 July 16th 07 09:48 PM
RowSource Patrick Simonds Excel Programming 1 August 5th 06 01:25 AM
help with rowsource GMet Excel Programming 4 September 24th 04 02:30 PM
Using IF, Then with rowsource? CAA[_23_] Excel Programming 8 April 4th 04 08:56 PM


All times are GMT +1. The time now is 03:27 PM.

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"