ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   present data as hierarchy/tree structure in user form (https://www.excelbanter.com/excel-programming/327449-present-data-hierarchy-tree-structure-user-form.html)

Malin

present data as hierarchy/tree structure in user form
 
I have a work sheet in excel with data in 8 different columns. By
using a macro I can view this data with drop down lists in a user
form, like with auto filters in the user form. I would like to show
the data in another way and would like to know if it is possible to
build a tree structure in the user form instead?

Example:

Cars
BMW
Mercedes
Audi
Bicycles
Crescent
Monark
BMX

Instead of choosing Cars and Bicycles in drop down lists I would like
a tree structure to expand when clicking on the word Cars (BMW,
Mercedes, Audi then appears beneath) for instance in the user form.

The functionality is similar to having groups in the work sheet except
I would like it to be presented in a user form instead.

Grateful for all the help I can get!

/Malin

Tom Ogilvy

present data as hierarchy/tree structure in user form
 
the simplest approach is to populate a listbox/combobox using code and
indent some of the items by prepending/padding them with spaces.

There is no control shipped with Office that does this. If you have VB6 you
might look at the treeview control

--
Regards,
Tom Ogilvy

"Malin" wrote in message
om...
I have a work sheet in excel with data in 8 different columns. By
using a macro I can view this data with drop down lists in a user
form, like with auto filters in the user form. I would like to show
the data in another way and would like to know if it is possible to
build a tree structure in the user form instead?

Example:

Cars
BMW
Mercedes
Audi
Bicycles
Crescent
Monark
BMX

Instead of choosing Cars and Bicycles in drop down lists I would like
a tree structure to expand when clicking on the word Cars (BMW,
Mercedes, Audi then appears beneath) for instance in the user form.

The functionality is similar to having groups in the work sheet except
I would like it to be presented in a user form instead.

Grateful for all the help I can get!

/Malin





All times are GMT +1. The time now is 09:08 PM.

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