LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Adding Column Headings to a ListBox


I'm having a problem getting column headings to show up in a list box
control. I thought that, if the ColumnHeads property was set to True, the
first row of data would show up as column headings in the list box. This
column heading row would not be a selectable row. Here's a simple example
that illustrates my problem:

TestForm.TestListBox.Visible = True
TestForm.TestListBox.Clear
Dim n as Integer
For n = 1 To 10
If n = 1 Then
TestForm.TestListBox.AddItem
TestForm.TestListBox.List(n - 1, 0) = "Col 1"
TestForm.TestListBox.List(n - 1, 1) = "Col 2"
TestForm.TestListBox.List(n - 1, 2) = "Col 3"
End If
TestForm.TestListBox.AddItem
TestForm.TestListBox.List(n, 0) = n
TestForm.TestListBox.List(n, 1) = n + 1
TestForm.TestListBox.List(n, 2) = n + 2
Next n
TestForm.Show

The above section of code populates the list box ok, however, the list box
column heading row remains blank. The intended column headings (Col 1, Col 2
and Col 3) show up as the first selectable row in the list box which is not
what I want to do.

Any help would be greatly appreciated.

p.s. The source data for the list box is contained in specific columns for
a subset of rows in an existing spreadsheet.


 
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
Adding range search results to multi-column listbox Ken Warthen[_2_] Excel Programming 8 April 22nd 09 12:29 PM
Worksheet has numeric column headings. Change to alpha headings? Be Frank Excel Discussion (Misc queries) 1 June 18th 08 04:22 PM
Column headings to numbers and row headings to alphabets? Juliana Excel Discussion (Misc queries) 2 May 9th 08 05:58 PM
Adding "letters (column headings)" Rachael Excel Discussion (Misc queries) 7 June 13th 06 05:07 PM
Listbox column headings BT[_3_] Excel Programming 3 December 30th 04 09:08 PM


All times are GMT +1. The time now is 08:28 AM.

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"