#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Listbox

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Listbox

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


"Todd Huttenstine" wrote
in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Listbox

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.


--
HTH

Bob Phillips

"Todd Huttenstine" wrote in message
oups.com...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Listbox

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Listbox

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?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Listbox

It is a string property

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

--
HTH

Bob Phillips

"Todd Huttenstine" wrote in message
ups.com...
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?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Listbox

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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Listbox

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

--
HTH

Bob Phillips

"Todd Huttenstine" wrote in message
ups.com...
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



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Listbox

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)

--
HTH

Bob Phillips

"Todd Huttenstine" wrote in message
ups.com...
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?



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 B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Multicolumn Listbox and ordinary listbox Ron_D Excel Programming 0 June 4th 04 08:56 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"