Hello helpful excel folk!
I have been given a data export to cross reference that looks like it was created as some kind of pivot and the only data structures are the cell indents in the first column.
I have already used a small VBA script to populate the indent level of the cell data and now I am struggling to transpose that data based on each group of cells between indent level 0's while iterating through the other indent levels in the group. If there was a standard number of rows or indent levels it would probably be easy but this has variable numbers of locations and pages under each company.
Here is an example of the data i have with the indent level and what i am trying to have the resulting data look like:
<tbody>
[TD="class: xl70"]Data[/TD]
[TD="class: xl71, width: 64"]Time[/TD]
[TD="class: xl72, width: 81"]IndentLevel
[/TD]
[TD="class: xl73"]Company 1[/TD]
[TD="class: xl64, align: right"]9[/TD]
[TD="class: xl74, align: right"]0[/TD]
[TD="class: xl75"]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl76, align: right"]1[/TD]
[TD="class: xl77"]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl77"]
[TD="class: xl66, align: right"]1[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl77"]
[TD="class: xl66, align: right"]6[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl78"]Company 2[/TD]
[TD="class: xl67, align: right"]4[/TD]
[TD="class: xl79, align: right"]0[/TD]
[TD="class: xl80"]
[TD="class: xl68, align: right"]1[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl82"]
[TD="class: xl69, align: right"]1[/TD]
[TD="class: xl79, align: right"]2[/TD]
[TD="class: xl80"]
[TD="class: xl68, align: right"]2[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl82"]
[TD="class: xl69, align: right"]2[/TD]
[TD="class: xl79, align: right"]2[/TD]
[TD="class: xl80"]
[TD="class: xl68, align: right"]1[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl83"]
[TD="class: xl84, align: right"]1[/TD]
[TD="class: xl85, align: right"]2[/TD]
</tbody>
<tbody>
[TD="class: xl66"]Company[/TD]
[TD="class: xl66, width: 74"]Location[/TD]
[TD="class: xl66, width: 64"]Page[/TD]
[TD="class: xl66, width: 64"]Time[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 2[/TD]
[TD="class: xl66, align: right"]1[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 3[/TD]
[TD="class: xl66, align: right"]6[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]1[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 2[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 3[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]1[/TD]
</tbody>
Any insight you can give me to solve this would be greatly appreciated.
-Meta1
I have been given a data export to cross reference that looks like it was created as some kind of pivot and the only data structures are the cell indents in the first column.
I have already used a small VBA script to populate the indent level of the cell data and now I am struggling to transpose that data based on each group of cells between indent level 0's while iterating through the other indent levels in the group. If there was a standard number of rows or indent levels it would probably be easy but this has variable numbers of locations and pages under each company.
Here is an example of the data i have with the indent level and what i am trying to have the resulting data look like:
<tbody>
[TD="class: xl70"]Data[/TD]
[TD="class: xl71, width: 64"]Time[/TD]
[TD="class: xl72, width: 81"]IndentLevel
[/TD]
[TD="class: xl73"]Company 1[/TD]
[TD="class: xl64, align: right"]9[/TD]
[TD="class: xl74, align: right"]0[/TD]
[TD="class: xl75"]
Location 1
[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl76, align: right"]1[/TD]
[TD="class: xl77"]
Page 1
[/TD]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl77"]
Page 2
[/TD][TD="class: xl66, align: right"]1[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl77"]
Page 3
[/TD][TD="class: xl66, align: right"]6[/TD]
[TD="class: xl74, align: right"]2[/TD]
[TD="class: xl78"]Company 2[/TD]
[TD="class: xl67, align: right"]4[/TD]
[TD="class: xl79, align: right"]0[/TD]
[TD="class: xl80"]
Location 1
[/TD]
[TD="class: xl68, align: right"]1[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl82"]
Page 1
[/TD]
[TD="class: xl69, align: right"]1[/TD]
[TD="class: xl79, align: right"]2[/TD]
[TD="class: xl80"]
Location 2
[/TD]
[TD="class: xl68, align: right"]2[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl82"]
Page 1
[/TD]
[TD="class: xl69, align: right"]2[/TD]
[TD="class: xl79, align: right"]2[/TD]
[TD="class: xl80"]
Location 3
[/TD]
[TD="class: xl68, align: right"]1[/TD]
[TD="class: xl81, align: right"]1[/TD]
[TD="class: xl83"]
Page 1
[/TD]
[TD="class: xl84, align: right"]1[/TD]
[TD="class: xl85, align: right"]2[/TD]
</tbody>
<tbody>
[TD="class: xl66"]Company[/TD]
[TD="class: xl66, width: 74"]Location[/TD]
[TD="class: xl66, width: 64"]Page[/TD]
[TD="class: xl66, width: 64"]Time[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 2[/TD]
[TD="class: xl66, align: right"]1[/TD]
[TD="class: xl66"]Company 1[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 3[/TD]
[TD="class: xl66, align: right"]6[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 1[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]1[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 2[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]2[/TD]
[TD="class: xl66"]Company 2[/TD]
[TD="class: xl66"]Location 3[/TD]
[TD="class: xl66"]Page 1[/TD]
[TD="class: xl66, align: right"]1[/TD]
</tbody>
Any insight you can give me to solve this would be greatly appreciated.
-Meta1