Counting Indents
I haven't worked with Hyperion, but am surprised that a non-excel program
provides text indents that Excel recognizes as such.
I am not aware of any Excel function or formula that returns an indent level.
The vba phrase you need is "IndentLevel";
it is a property of the range object. (and Style object).
It can be used as... Cells(2, 4).IndentLevel
A vba worksheet function you can call from the cell immediately
to the right of the indented cell is...
'--
Function HowMany() As Double
On Error GoTo NotEnough
Application.Volatile
HowMany = Application.Caller.Offset(0, -1).IndentLevel
Exit Function
NotEnough:
HowMany = 9999
End Function
--
Note - changing the indent level requires a sheet calculation to update the function.
Jim Cone
Portland, Oregon USA
"MParham"
wrote in message
I have a Hyperion report that gives me the Chart of Accounts in a way that
each level is indented when viewed in Excel. There are no spaces to count, it
is all done with indents. I need to convert the file dividing them out into
Level groups so I need to know how many times the item was indented so I can
write a macro or formula to move it to the proper level. When an item is
indented, how do you get the computer to calculate the number of indents? If
you can't do that, can I replace each indent with another character I can
count via formula?
An example of what I have is:
Account 1
Account 1a
Account 1b
Account 1b1
Account 2
That is just something to show how my report comes in. I used spaces in the
above example but the report does not, it uses indents and I need to be able
to calculate how many indents on each Account so I can use another formula to
automatically place it in the right place of another form.
|