jocker_boy
Board Regular
- Joined
- Feb 5, 2015
- Messages
- 83
Hi,
I want to sum values based on indent level in another column. Example:
[TABLE="width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]text
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]0
[/TD]
[TD]9
[/TD]
[/TR]
[TR]
[TD]A.1
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]A.2
[/TD]
[TD]4
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]A.3
[/TD]
[TD]5
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]0
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]B.1
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]B.2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]0
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]C.1
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]C.2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]
I have my different strings in column A:A
And in column B:B i have a formula to find the string in column A in one text cell (Row 1:1).
But i want to organize by "headers"
The goal is obtain column C:C automatically, because i have several tables and they are not equal.
I was thinking in somethig like:
In cell B2: if indent of A2=0, sum cell B3:BXX, until the next indent of column A=0.
Does this make any sense?
I have already a VBA code to get the indent:
Thanks,
Gonçalo
I want to sum values based on indent level in another column. Example:
[TABLE="width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]text
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]0
[/TD]
[TD]9
[/TD]
[/TR]
[TR]
[TD]A.1
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]A.2
[/TD]
[TD]4
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]A.3
[/TD]
[TD]5
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]0
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]B.1
[/TD]
[TD]1
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]B.2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]0
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]C.1
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]C.2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]
I have my different strings in column A:A
And in column B:B i have a formula to find the string in column A in one text cell (Row 1:1).
But i want to organize by "headers"
The goal is obtain column C:C automatically, because i have several tables and they are not equal.
I was thinking in somethig like:
In cell B2: if indent of A2=0, sum cell B3:BXX, until the next indent of column A=0.
Does this make any sense?
I have already a VBA code to get the indent:
Code:
Function PROFEXIndentLevel(Cell As Range)
'This function returns the indentation of a cell content
Application.Volatile
'With "Application.Volatile" you can make sure, that the function will be recalculated once the worksheet is recalculated
'for example, when you press F9 (Windows) or press enter in a cell
PROFEXIndentLevel = Cell.IndentLevel
'Return the IndentLevel
End Function
Thanks,
Gonçalo