ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox headers (https://www.excelbanter.com/excel-programming/440317-listbox-headers.html)

Robert Crandal

Listbox headers
 
For my listbox control, I set the value of "ColumnHeads" to True,
meaning that my listbox will contain headers for my columns. I
can now see the headers in my listbox, I just dont know how to
enter text into each header. how do i do that?

thank u

Robert


Dave Peterson

Listbox headers
 
Those headers come from the row above the range you use for the .rowsource.

If your .rowsource is (say) A2:A10, then the column headings will be from row 1.



Robert Crandal wrote:

For my listbox control, I set the value of "ColumnHeads" to True,
meaning that my listbox will contain headers for my columns. I
can now see the headers in my listbox, I just dont know how to
enter text into each header. how do i do that?

thank u

Robert


--

Dave Peterson

Robert Crandal

Listbox headers (Permission denied)
 
Ok, that works. If I set the .Rowsource, I can now see text in my
headers. However, if I now try to add a new item into the listbox
(using Listbox1.AddItem), I get an error message that says
"Permission Denied". What happened now??



"Dave Peterson" wrote in message
...
Those headers come from the row above the range you use for the
.rowsource.

If your .rowsource is (say) A2:A10, then the column headings will be from
row 1.




Dave Peterson

Listbox headers (Permission denied)
 
You can use the rowsource or you can use additem. You can't use both.

And watch what happens when you use the column headers and additem.

Robert Crandal wrote:

Ok, that works. If I set the .Rowsource, I can now see text in my
headers. However, if I now try to add a new item into the listbox
(using Listbox1.AddItem), I get an error message that says
"Permission Denied". What happened now??

"Dave Peterson" wrote in message
...
Those headers come from the row above the range you use for the
.rowsource.

If your .rowsource is (say) A2:A10, then the column headings will be from
row 1.



--

Dave Peterson


All times are GMT +1. The time now is 07:20 AM.

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