Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default RowSource as a row

Hi;
what is the proper syntax for RowSource:
ListBox1.RowSource=Range("A1:L1")
gives me just A1 cell as the only element
in the ListBox.List. Thanks. Boba


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default RowSource as a row

you can try this

Private Sub UserForm_Activate()
Dim ws As Worksheet
Dim i As Long
Set ws = Worksheets("Sheet1")
For i = 1 To 12
Me.ListBox1.AddItem ws.Cells(1, i)
Next
End Sub

--


Gary


"Boba" wrote in message
...
Hi;
what is the proper syntax for RowSource:
ListBox1.RowSource=Range("A1:L1")
gives me just A1 cell as the only element
in the ListBox.List. Thanks. Boba



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default RowSource as a row

You only have one row in A1:L1.

If you want each of the values in A1:L1 as your list:

listbox1.list = application.transpose(range("a1:L1").value)



Boba wrote:

Hi;
what is the proper syntax for RowSource:
ListBox1.RowSource=Range("A1:L1")
gives me just A1 cell as the only element
in the ListBox.List. Thanks. Boba


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default RowSource as a row

Try something more like this...

ListBox1.RowSource=Sheets("Sheet1").Range("A1:L1") .Address
--
HTH...

Jim Thomlinson


"Boba" wrote:

Hi;
what is the proper syntax for RowSource:
ListBox1.RowSource=Range("A1:L1")
gives me just A1 cell as the only element
in the ListBox.List. Thanks. Boba



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default RowSource as a row

My code does not work (in retrospect). Use Dave's
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Try something more like this...

ListBox1.RowSource=Sheets("Sheet1").Range("A1:L1") .Address
--
HTH...

Jim Thomlinson


"Boba" wrote:

Hi;
what is the proper syntax for RowSource:
ListBox1.RowSource=Range("A1:L1")
gives me just A1 cell as the only element
in the ListBox.List. Thanks. Boba



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
Refreshing ROWSOURCE DKS Excel Programming 7 September 23rd 06 05:56 PM
RowSource Patrick Simonds Excel Programming 1 August 5th 06 01:25 AM
RowSource in ListBox Noah Excel Programming 2 November 17th 05 02:00 PM
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 10:33 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"