Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default RowSource in ListBox

Is it possible to have the rowsource in a listbox set to the following range
("rng") that I have defined in a vb module? I keep getting the following
message: "Could not set the RowSource property. Invalid property value." Do
I need to insert the code somewhere else? Thank you!
----
Dim rng As Range
lastrow = Cells(1, 1).End(xlDown).Row
rng = Sheet1.Range(Cells(1, 1), Cells(lastrow, 2))
----------

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default RowSource in ListBox

Hi Noah:

Try

Dim rng As Range
lastrow = Cells(1, 1).End(xlDown).Row
Set rng = Sheet1.Range(Sheet1.Cells(1, 1), Sheet1.Cells(lastrow, 2))
Me.ListBox1.RowSource = rng.Address

--
http://www.vba.com.tw/plog/


"Noah" wrote:

Is it possible to have the rowsource in a listbox set to the following range
("rng") that I have defined in a vb module? I keep getting the following
message: "Could not set the RowSource property. Invalid property value." Do
I need to insert the code somewhere else? Thank you!
----
Dim rng As Range
lastrow = Cells(1, 1).End(xlDown).Row
rng = Sheet1.Range(Cells(1, 1), Cells(lastrow, 2))
----------

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default RowSource in ListBox

Thank you for your help, but, unfortunately, I still can't seem to get it to
work. Since several days have elapsed since the original post, I will post
the question again.

"chijanzen" wrote:

Hi Noah:

Try

Dim rng As Range
lastrow = Cells(1, 1).End(xlDown).Row
Set rng = Sheet1.Range(Sheet1.Cells(1, 1), Sheet1.Cells(lastrow, 2))
Me.ListBox1.RowSource = rng.Address

--
http://www.vba.com.tw/plog/


"Noah" wrote:

Is it possible to have the rowsource in a listbox set to the following range
("rng") that I have defined in a vb module? I keep getting the following
message: "Could not set the RowSource property. Invalid property value." Do
I need to insert the code somewhere else? Thank you!
----
Dim rng As Range
lastrow = Cells(1, 1).End(xlDown).Row
rng = Sheet1.Range(Cells(1, 1), Cells(lastrow, 2))
----------

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
Listbox rowsource on Userform Wendy Excel Discussion (Misc queries) 6 February 28th 08 05:46 PM
RowSource in ListBox aet-inc[_2_] Excel Programming 1 December 3rd 03 12:41 AM
ListBox Rowsource Limitation?? Dave Baranas Excel Programming 2 September 29th 03 05:01 PM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
listbox rowsource Christy[_2_] Excel Programming 4 September 20th 03 11:44 PM


All times are GMT +1. The time now is 11:14 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"