how to find lowest level of hierarchy

Microsoft / P-4
June 2, 2009 at 23:54:07
Specs: Windows XP, PENTIMUM -4/1GB

i am gettng the output of my one of the report as below

where last line is the substitue of secondline and secodline is the substitue of first line.

can you plese help me to define macor which find the loweset level so in this case gives first line as output.


See More: how to find lowest level of hierarchy

Report •

June 3, 2009 at 07:08:20
What do you mean when you say some lines are substitutes for the other lines. Do you mean subset?

Report •

June 3, 2009 at 09:33:01
Hi, Thanks for quick reply.

i just mean to say i am getting output in Heirarchy level where each level contains the previous level and some more text.

for example.
code description
12345 i love
12345 i love india
12345 i love india and indians.

but through macro i just want thired line not first two lines for the same code 12345.

please let me know if anything still unclear.


Report •

June 3, 2009 at 21:27:46
Not possible without further logic. what if the next line is 12345 i love india and elephants? which has the higher priority? In this case you sould not change any.

Report •

Related Solutions

June 6, 2009 at 10:45:11
Thanks for the quick reply

i just want to make macro which goes at lowest possible level for the code 12345 in column A.

so in the example if one more layer is there "12345 i love india and elephants" it should retun that only.

so as per my logic macro should first check the codes present in column a weather it is same or not.

and secondly it should check the text present in the column B is part of immediate next cell if yes then it should move to next cell and check again weather the code in column A is same with previous cell and again the text is part of next cell in column B and so on.....

one point i would like to note if text in column B is not the part of immediate cell then it should return the same cell.

this is the logic please help or reply for more clarification.

Report •

June 6, 2009 at 10:53:37
12345 i love india
12345 i love india and frog legs
12345 i love india and frog arms

What's your definition of "lowest level" in that example? And Why?

Report •

June 6, 2009 at 11:06:01
col A column B
line1 12345 i love india
line2 12345 i love india and frog legs
line3 12345 i love india and frog arms

in the above case i have two lowest level of line 1 as both contains text of line 1 but both line number 2 and 3 is not same.

Actully i dont want to repeat the output that code 12345 is present in line 1 as the same code is present in it lower levels lines 2 and 3.

so i just want different lowest levels in that hierarchy.

so lowest level may be 1 or more but it is more in only case when the text in column B is different for all lowest levels.

thanks for quick help and i hope its clear

Report •

Ask Question