Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default List Box Row Source

Must the row source property be (e.g.) Reports!A1:D5 ?

Or can you specify individual columns like A1:A5, E1:E5, B1:B5

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default List Box Row Source

No, but you could load the listbox from those ranges.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"kirkm" wrote in message
...
Must the row source property be (e.g.) Reports!A1:D5 ?

Or can you specify individual columns like A1:A5, E1:E5, B1:B5

Thanks - Kirk



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default List Box Row Source

Here is a snippet from VBA Help file:

Private Sub UserForm_Initialize()

ListBox1.ColumnCount = 5
ListBox1.RowSource = "a1:e4"
ListBox1.ControlSource = "a6"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Note that the RowSource is a simple five column range in quotes. You can
specify your range with single or multiple columns using RowSource so long as
the columuns are contiguous (side by side). Discontiguous columns must be
handled in an array.


"kirkm" wrote:

Must the row source property be (e.g.) Reports!A1:D5 ?

Or can you specify individual columns like A1:A5, E1:E5, B1:B5

Thanks - Kirk

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default List Box Row Source

On Thu, 8 Mar 2007 15:54:22 -0800, JLGWhiz
wrote:

Here is a snippet from VBA Help file:

Private Sub UserForm_Initialize()

ListBox1.ColumnCount = 5
ListBox1.RowSource = "a1:e4"
ListBox1.ControlSource = "a6"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Note that the RowSource is a simple five column range in quotes. You can
specify your range with single or multiple columns using RowSource so long as
the columuns are contiguous (side by side). Discontiguous columns must be
handled in an array.


Ok. Thanks. I can make them contiguous to start with.

Could you give me an example of ListIndex? I don't understand that.

Also - another problem. In the cells the numbers are formatted
correctly, but the listbox seems to overide that and present them
left justified. Can I resolve that - or should I use text mode and
leading spaces?

Thanks - Kirk



"kirkm" wrote:

Must the row source property be (e.g.) Reports!A1:D5 ?

Or can you specify individual columns like A1:A5, E1:E5, B1:B5

Thanks - Kirk

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default List Box Row Source

You can set the text alignment (right, left or center) in the properties
window of the listbox control when you create it if you are using the control
toolbox for a UserForm. If you are creating it on the worksheet, you will
have to have the control toolbox in design mode to see the properties window.

List index has three different applications. I suggest you use the VBA help
file to review these and decide for yourself what it means. You can access
the VBA help file in the VB editor by pressing Alt+f11, the click on Help in
that window and enter the word ListIndex (one word) in the search box. This
will pull up the menu for you to access the three applications of ListIndex.

"kirkm" wrote:

On Thu, 8 Mar 2007 15:54:22 -0800, JLGWhiz
wrote:

Here is a snippet from VBA Help file:

Private Sub UserForm_Initialize()

ListBox1.ColumnCount = 5
ListBox1.RowSource = "a1:e4"
ListBox1.ControlSource = "a6"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Note that the RowSource is a simple five column range in quotes. You can
specify your range with single or multiple columns using RowSource so long as
the columuns are contiguous (side by side). Discontiguous columns must be
handled in an array.


Ok. Thanks. I can make them contiguous to start with.

Could you give me an example of ListIndex? I don't understand that.

Also - another problem. In the cells the numbers are formatted
correctly, but the listbox seems to overide that and present them
left justified. Can I resolve that - or should I use text mode and
leading spaces?

Thanks - Kirk



"kirkm" wrote:

Must the row source property be (e.g.) Reports!A1:D5 ?

Or can you specify individual columns like A1:A5, E1:E5, B1:B5

Thanks - Kirk




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default List Box Row Source

On Thu, 8 Mar 2007 17:36:08 -0800, JLGWhiz
wrote:

You can set the text alignment (right, left or center) in the properties
window of the listbox control when you create it if you are using the control
toolbox for a UserForm.



It's only the numbers I want right justified, not the text.
Can you apply justification on a column by column basis?


List index has three different applications. I suggest you use the VBA help
file to review these and decide for yourself what it means.


I can't understand much of Help in any Microsoft application. It's
really no help to a beginner becuise the terms they use are
meaningless.

Cheers - Kirk

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
Using one source list for two depends drop-down list Grand Seigneur Excel Discussion (Misc queries) 2 March 10th 10 03:19 PM
Updating Source List irish2171 Excel Discussion (Misc queries) 5 July 20th 07 09:32 PM
List Box Row Source jhahes[_62_] Excel Programming 1 June 23rd 06 05:09 PM
list ODBC source matis Excel Programming 2 May 14th 04 01:15 PM
List source must be on same worksheet? kiln Excel Programming 2 April 7th 04 07:29 AM


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