Listbox

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Hey guys

I have a userform with a listbox (ListBox1) on it. I want to show 3
column headers on the listbox called:

Market ID Market Cd Mkt Name


How do I do this?


Thank you
Todd Huttenstine
 
In your ListBox, set the ColumnCount property to 3, ColumnHeads
to True, and RowSource to the range of cells *below* the text
that serves as column headers. The cells above the RowSource
range will be used as column headers.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


in message
news:[email protected]...
 
Set the ColumnCount property to 3
Set the ColumnHeads property to True
Set Rowsource property to the worksheet range

If you want the first row on the worksheet as your headings, set Rowsource
from the second row down.
 
When I try to set the rowsource property it gives me an error. Here is
how I am doing it:

ListBox1.RowSource = Worksheets("Market IDs All
Regions").Range("A2:D14")

What should I specifiy?
Also what does control cource do?
 
Also lets say I want to change 1 specific value in the listbos xuch as
row 3 column 2... How would I update this one value in the listbox?
 
It is a string property

ListBox1.RowSource = Worksheets("Market IDs All
Regions").Range("A2:D14").address
 
Below is what I am using for my rowsource and I still keep getting an
error. What am I doing wrong?


ListBox1.RowSource = Workbooks("B2B Master.xls").Worksheets("Market IDs
All Regions").Range("A2:D14").Address
 
Todd,

A similar test worked fine for me.

Check the obvious.
- the workbook is opne
- it is called B2B Master.xls
- the worksheet is called Marked IDs All Regions
 
Normally you would get column 2 for the selected item

ListBox1.List(ListBox1.ListIndex, 2)

but if you wanted a specific row, it is

ListBox1.List(2,1)
 
Back
Top