ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox Headings (https://www.excelbanter.com/excel-programming/346390-listbox-headings.html)

vqthomf

Listbox Headings
 
Hi I have seen some programmes that look like they have been written in VB
that has headings at the top of the listbox, this allows the user to expand
the columns with the mouse can this be done in VBA?.
TIA
Charles

Leith Ross[_321_]

Listbox Headings
 

Hello Charles,

What you are describing is a ListView control. This control is
available in VBA, but you have to add it to the Toolbox. In the VB
Editior select a UserForm in your project. Insert one if you don't have
one. You can remove it when you are done. Click on the Tools icon to
display the toolbox. Click on Tools on the menu bar and select
Additional Controls. Look in the list for Microsoft ListView Control.
You may have more than 1 version. If you plan to have others use your
code, select the oldest version. If it is only for your system use the
newest.

This is a very flexible and robust control. The downside is programming
it can be difficult. The upside is once you know how you may never want
to use anything else.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=487551


vqthomf

Listbox Headings
 
Thanks Leith, Do You Know Where I can Find Examples of code so that I can
work it out?.
TIA
Charles

"Leith Ross" wrote:


Hello Charles,

What you are describing is a ListView control. This control is
available in VBA, but you have to add it to the Toolbox. In the VB
Editior select a UserForm in your project. Insert one if you don't have
one. You can remove it when you are done. Click on the Tools icon to
display the toolbox. Click on Tools on the menu bar and select
Additional Controls. Look in the list for Microsoft ListView Control.
You may have more than 1 version. If you plan to have others use your
code, select the oldest version. If it is only for your system use the
newest.

This is a very flexible and robust control. The downside is programming
it can be difficult. The upside is once you know how you may never want
to use anything else.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=487551



Leith Ross[_323_]

Listbox Headings
 

Hello Charles,

To start with, I can pull some basic examples from a project I am
working on that uses a ListView. This will show you how to setup the
headings, sort, add and remove data from the control. I can post it
later on today. It's 2:33 AM Pacfic time, and I am not awake enough to
do it. You can email with questions at .

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=487551



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

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