Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default listbox problem #2

Thank you to those who replied to my question about
changing list box text. The comments were very helpful.
Today I need to put text into the listbox column
headings. The listbox property has been set to show
three columns. Using help, I have been unable to find a
code statement that will do this. Any suggestions?

Keith
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default listbox problem #2

Hi Keith

You can't do that by code. Listbox column headers appear only when you
populate the box with a spreadsheet range that has columnheaders.

HTH. Best wishes Harald

"Keith" skrev i melding
...
Thank you to those who replied to my question about
changing list box text. The comments were very helpful.
Today I need to put text into the listbox column
headings. The listbox property has been set to show
three columns. Using help, I have been unable to find a
code statement that will do this. Any suggestions?

Keith



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default listbox problem #2

I don't recall the "listbox problem 1" question (maybe the OP was looping
through the range to selectively add stuff to the listbox????).

But I can use code and have headers:

Option Explicit
Private Sub UserForm_Activate()
With Me.ListBox1
.ColumnCount = 3
.RowSource _
= Worksheets("Sheet1").Range("a2:c10").Address(exter nal:=True)
.ColumnHeads = True
End With
End Sub

(I figure there was a lot of stuff from the original thread that I missed).

=====
To the OP:

Maybe you could add some labels right above the listbox and use them for
headers.

Harald Staff wrote:

Hi Keith

You can't do that by code. Listbox column headers appear only when you
populate the box with a spreadsheet range that has columnheaders.

HTH. Best wishes Harald

"Keith" skrev i melding
...
Thank you to those who replied to my question about
changing list box text. The comments were very helpful.
Today I need to put text into the listbox column
headings. The listbox property has been set to show
three columns. Using help, I have been unable to find a
code statement that will do this. Any suggestions?

Keith


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default listbox problem #2

"Dave Peterson" skrev i melding
...

But I can use code and have headers:


Bad choice of words from me, sorry. Yes, one can set the Rowsource /
Listfillrange by code also. But one can not have columnheaders if the list
is populated using VBA code .Additem or .List

Best wishes Harald


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default listbox problem #2

Excellent choice of words this time <bg.

Harald Staff wrote:

"Dave Peterson" skrev i melding
...

But I can use code and have headers:


Bad choice of words from me, sorry. Yes, one can set the Rowsource /
Listfillrange by code also. But one can not have columnheaders if the list
is populated using VBA code .Additem or .List

Best wishes Harald


--

Dave Peterson
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 Problem browie Excel Discussion (Misc queries) 5 August 22nd 05 02:03 PM
Listbox problem browie Excel Discussion (Misc queries) 1 August 22nd 05 11:44 AM
listbox problem [email protected] Excel Programming 1 March 10th 05 01:08 PM
Listbox Problem [email protected] Excel Programming 4 August 19th 04 06:47 PM
listbox problem CAA[_11_] Excel Programming 4 January 7th 04 03:27 PM


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