ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MultiColumn ComboBox (https://www.excelbanter.com/excel-programming/336190-multicolumn-combobox.html)

Paul Smith[_3_]

MultiColumn ComboBox
 
I need to build the contents of a multi-column combobox through code.

I have an array of the data I need to load, I can do this by using a
combination of 'additem' and them 'column' property of the combo box. This
all works satisfactorily however I have a problem setting the column
headings, or more accurately setting these so they cannot be selected.

I have tried using the setting the 'ListHeaderCount' property to 1, and this
inserts the separator, but does not stop the top header row from being able
to be selected.

If you base a combobox on a named range by setting the combobox's
'RowSource' as the named range. The row above each column is automatically
inserted as a non-selectable header. How do you do this in code, building
the Combobox through code?

PWS



Tom Ogilvy

MultiColumn ComboBox
 
It isn't supported. Only using rowsource.

--
Regards,
Tom Ogilvy


"Paul Smith" wrote in message
...
I need to build the contents of a multi-column combobox through code.

I have an array of the data I need to load, I can do this by using a
combination of 'additem' and them 'column' property of the combo box.

This
all works satisfactorily however I have a problem setting the column
headings, or more accurately setting these so they cannot be selected.

I have tried using the setting the 'ListHeaderCount' property to 1, and

this
inserts the separator, but does not stop the top header row from being

able
to be selected.

If you base a combobox on a named range by setting the combobox's
'RowSource' as the named range. The row above each column is

automatically
inserted as a non-selectable header. How do you do this in code, building
the Combobox through code?

PWS





Gareth[_6_]

MultiColumn ComboBox
 
Depending on the application, you might get the look and feel you want
using a ListView - although this is more similar to a listbox than a
combobox:

http://msdn.microsoft.com/library/de...umnheaders.asp

This lets you have column titles, user moveable columns etc.

With ListView 6.0 you can set the FullRowselect property to True to
mimic ListBox behaviour.

HTH,
Gareth

Paul Smith wrote:
I need to build the contents of a multi-column combobox through code.

I have an array of the data I need to load, I can do this by using a
combination of 'additem' and them 'column' property of the combo box. This
all works satisfactorily however I have a problem setting the column
headings, or more accurately setting these so they cannot be selected.

I have tried using the setting the 'ListHeaderCount' property to 1, and this
inserts the separator, but does not stop the top header row from being able
to be selected.

If you base a combobox on a named range by setting the combobox's
'RowSource' as the named range. The row above each column is automatically
inserted as a non-selectable header. How do you do this in code, building
the Combobox through code?

PWS




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com