From: Sam on 23 Apr 2010 11:53 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.
From: JLGWhiz on 23 Apr 2010 12:00 Try this: Me.listbox1.RowSource = Range("CashierList").Address. The row source must equate to A1 format. "Sam" <Sam(a)discussions.microsoft.com> wrote in message news:D9F33C90-EB88-4346-BAA7-6C9021D6083D(a)microsoft.com... >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.
From: JLGWhiz on 23 Apr 2010 12:09 Actually, you could just: Me.ListBox1.RowSource = "CashierList" That would make the row source a string value in A1 format. "Sam" <Sam(a)discussions.microsoft.com> wrote in message news:D9F33C90-EB88-4346-BAA7-6C9021D6083D(a)microsoft.com... >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.
From: B Lynn B on 23 Apr 2010 12:33 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.
From: Sam on 23 Apr 2010 13:06 Thanks! Got it.... "JLGWhiz" wrote: > Try this: > > Me.listbox1.RowSource = Range("CashierList").Address. > > > The row source must equate to A1 format. > > "Sam" <Sam(a)discussions.microsoft.com> wrote in message > news:D9F33C90-EB88-4346-BAA7-6C9021D6083D(a)microsoft.com... > >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. > > > . >
|
Pages: 1 Prev: Remove unnecessary rows Next: If cell contatin string like .... copy in Offset mode |