Problem Listbox Header from VBA Userform

Doflamingo

Board Regular
Joined
Apr 16, 2019
Messages
238
Dear all,

I currently have problem with the header added to my listbox. It has been activated (listbox property where columnheads of the listbox = true) but I don’t know why the code below

Code:
Listbox1.rowsource = (“E1”)

Where in the cell E1 from an excel sheet its’ written ‘’blabla’’ but the header of the listbox makes appear in the header ‘’E1’’ and below the header ‘’blabla’’

How to make appear the value of the cell E1 in the lisbox header ?

Or if anyone knows how to populate header of listbox without using cells value of an excel sheet, I take it :)
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Since ColumnHeads is set to True, you don't include the header row in your reference. For example, let's say that E1 contains the header, and E2:E5 contains the list items, you should assign the row source as follows...

Code:
 [COLOR=#333333]Listbox1.rowsource = "E2:E5"


[/COLOR]

Hope this helps!
 
Last edited:
Upvote 0
Hi Hello @Domenic, many thanks for your explanations. It works :)

I know now how columnheads work but unfortunately it does not work with my multiple lines of code that look like this

Code:
If OptionButton1.Value = True And OptionButton5.Value = True Then Me.ListBox2.AddItem ("Wck")

Actually i just wanted column head because before I used ''labels'' to indicate what was the utility of the listbox and then I though having headcolumn just would be more convenient for the user of the VBA userform

but it prevents my code working so, not grave, but many thanks for your reply, help and time on that matter :)
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,217
Members
448,876
Latest member
Solitario

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