Create a tree structure in Excel - Possible VBA input

Rav_Singh

New Member
Joined
Jun 29, 2019
Messages
28
Hello all,

*Second time posting as the last thread did not display correctly*


This may be a long shot but I am throwing this out there to see if anyone can help. I would like to recreate a form of a three-structure in Excel.


Below is an sample set of folder structure data.

Commercial Litigation\Know-how
Commercial Litigation\Know-how\Court Documents & Guidance
Commercial Litigation\Know-how\Court Documents & Guidance\Disclosure Pilot - January 2019
Corporate Finance & Trust Acttu
Corporate Finance & Trust Acttu\Precedents and Non Function
Corporate Finance & Trust Acttu\Precedents and Non Function\Competition
Corporate Finance & Trust Acttu\Precedents and Non Function\Corporate Governance Trust
Corporate Finance & Trust Acttu\Precedents and Non Function\Corporate Governance Trust\Formation, Constitution
Corporate Finance & Trust Acttu\Precedents and Non Function\Corporate Governance Trust\Formation, Constitution\CA 2006


Ideally I would like the above example to transform into the below structure.

Commercial Litigation\ Know-how
> Court Documents & Guidance
> Disclosure Pilot - January 2019
Corporate Finance & Trust Acttu
> Precedents and Non Function
> Competition
> Corporate Governance Trust
> Formation, Constitution
> CA 2006

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

The key characteristics would be to;


1) Remove the duplicate folder location text (if same as above cell) but have space instead
2) Add the character '>' at the start of the new folder location text. The '>' should start at the end of where the text ended in the above cell.


I presume this can only be done in VBA.


I hope this makes sense.


Any help would be greatly appreciated.


Rav
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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