Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using one source list for two depends drop-down list | Excel Discussion (Misc queries) | |||
Updating Source List | Excel Discussion (Misc queries) | |||
List Box Row Source | Excel Programming | |||
list ODBC source | Excel Programming | |||
List source must be on same worksheet? | Excel Programming |