Trouble with ColumnHeads in multicolumn ListBox

Bagharmin

Board Regular
Joined
Nov 22, 2010
Messages
168
I have a multi-column ListBox and I'm trying to add column headers to it. I've set the ColumnHeads property to "True". The data that I want to display is dropped onto a separate sheet and sorted, with the column headers I want on the first row and the data itself starting at row 2. I then use the RowSource property to identify all the data, including the first row:

Code:
EmployeeList.ListBox1.RowSource = "'Sort Sheet'!$A$1:$E$" & PTOs + 1

There will always only be 5 columns, but there could be any number of rows. My only problem is that, when I show the EmployeeList userform, my column headers show up as the first row of data and the actual column headers say "Column A", "Column B", and so on.

What do I need to do differently to get the column headers on my sorting sheet to actually show up as the column headers in the ListBox?

Thanks.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Never mind. I got it. I needed the RowSource to start with the second row instead of the first (which had my column headers in it). Once I did that, the first row was automatically added as my column headers.
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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