Create Static Headers in a listbox

brodaddy2002

Board Regular
Joined
Jan 21, 2013
Messages
67
I am creating a dynamic listbox populates depending on a user selected box. I am aware that setting column headers property = true makes the headers the row one above the rowsource range. My problem is that the row above my dynamic range isn't always my header information.

Question: Is there a way to work around this? I guess that I could just easily apply Label boxes on top of the ListBox, but I just wanted to apply a little more finesse to the situation.

Thanks, I would greatly appreciate anyone's suggestions.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I first thought Union of Ranges would work, but alas, it does not.
I think the answer is simply no.
Using ColumnHeads directs the control to look one cell above the RowSource for a title/label.

Could copy source data + Label to a hidden worksheet and use that as your RowSource.
 
Upvote 0
Yeah, I thought about that, but I don't think that it will give me that much bang for the buck (I have a huge amount of data with 9 separate option buttons.) I was just trying to get fancy. Again, thanks for your help. I think that I will go with the brute force method of just adding the labels on top of the ListBox.


I guess I will keep this post open if anyone else might have ideas, but I think that it is simply one of the few limitations of excel VBA.
 
Upvote 0
another thought - don't know what it may do to your layout - but assuming all your data starts on the same row and titles are just offset somehow - add a row above the data - hide it (RowHeight=0), and include it in the RowSource.
 
Upvote 0
Are you using a userform? If you are then perhaps you can copy your list data to a range during the life of the userform class instance? In doing so you can plonk the header in the 1st row and then append the list data directly below it. You could use an existing sheet, or you could even add a sheet. If you use a new {temporary} sheet then tidying up is easy; just delete the sheet on userform hide/unload.
 
Upvote 0

Forum statistics

Threads
1,225,635
Messages
6,186,128
Members
453,340
Latest member
Stu61

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top