cancel
Showing results for 
Search instead for 
Did you mean: 

How to recognize hierarchy level using vba in excel workbook.

Former Member

I would like to be able manipulate hierarchy information using vba and determine the levels within to retrieve data. How do I know if the current cell in workbook represents a node or leave within a hierarchy?

Thnak you for assistance with this issue.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Welcome to SDN, Loren!

My 2 cents to what Peter said:

You may use IndentLevel of Worksheet.Range object. It identifies the hierarchy level. Go through debug and you'll get a clear picute of it.

Best regards,

Eugene

Former Member
0 Kudos

Thanks for the Welcome. I am new to SAP and even newer to SAP BW.

I will try this.

Thanks again.

Former Member
0 Kudos

Hi Loren,

There might not be a "best way" to do this. I can tell you one way that will work. You can test to see if an OLAP function related to the hierarchy is valid for that cell. For example:

retVal = Run("sapbex.xla!SAPBEXcheckContext", "HIRT", ActiveCell)

If the retVal is 0, then the "expand hierarchy" command is valid for that cell.

- Pete

Former Member
0 Kudos

Thanks for the information.

Will try it.