Link to home
Start Free TrialLog in
Avatar of FMabey
FMabeyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Indenting in Excel VBA

Hi all,

I have the following data:

2
2.1
2.1.1
2.1.2
2.2
2.2.1
2.2.2
2.2.3
2.3
2.3.1
2.4
2.5
2.6
2.6.1
2.6.1.1
2.6.1.2
2.6.2
3
3.1
3.1.1
3.1.2

This data is the first column of a list of parent and child items, so item 3.1 belongs to 3 and item 3.1.1 belongs to item 3.1 and so on.

What I would like to do is the following, showing each parent in a separate column:

2      
2.1            2
2.1.1            2.1
2.1.2            2.1
2.2            2
2.2.1            2.2
2.2.2            2.2
2.2.3            2.2
2.3            2
2.3.1            2.3
2.4            2
2.5            2
2.6            2
2.6.1            2.6
2.6.1.1            2.6.1
2.6.1.2            2.6.1
2.6.2            2.6
3
3.1            3
3.1.1            3.1
3.1.2            3.1
etc...

Has anyone got any clever ideas of how to achieve this is Excel VBA?

Thanks in advance
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

you could use formula:

=LEFT(A2,LEN(A2)-2)
ee.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Shanan212
Shanan212
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial