I want to implement a VBA function for Excel row numbers based on the depth of row grouping.
But I think the general TOC generation algorithm is more interesting.
The problem is this:
Given a list of "indentation" such as
One
Two
Three
Four
Five
Six
(the "indent level" can be considered well-known and part of the input data)
To create the following output:
1. One
1.1 Two
1.1.1 Three
1.1.1.1 Four
1.2 Five
2. Six
Of course, my code works and works ... and is also hidden under THWoS (The Heavy Weight of Shame)
source
share