View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JS SL JS SL is offline
external usenet poster
 
Posts: 49
Default After made a filter selection, hide to select visible rows based onthe registration in the visible cell related to the visible row above

Dear,

A new challange on the end of this year..... :)
Perhaps somebody like to solve and help me out.

I've got a list with data like;

Column N:
row2 x
Row3 x
Row4 data-A
Row5 data-A
Row6 data-B
Row7 x
Row8 data-B
Row9 x
Row10 x
Row11 data-A
Row12 data-A
Row13 data-A
Row14 data-B
Row15 data-A
Row16 x
Row17 x
Row18 x

Now I make a filterselection in column N for "Data-B" and "x"
(I need "x" also because its a special headingrow for selected 'Data-' fields).

So I get after the selection;

Column N:
row2 x
Row3 x
Row6 data-B
Row7 x
Row8 data-B
Row9 x
Row10 x
Row14 data-B
Row16 x
Row17 x
Row18 x

As you can see, the rows with other data then "Data-B" and "x" are hidden rows now.

The question now is to get a macro that will hide from those 'visible rows' the rows with an "x" in column N if the visible row direct below it, has also a "x" or the row below is empty (that means for the last rows)

Then you get;

Column N:
Row3 x
Row6 data-B
Row7 x
Row8 data-B
Row10 x
Row14 data-B

Something like...... Column N, From 2nd row till last, If visible cell contains "x" and below visible cell contains "x" or below visible cell is empty, then 'hide row'. Next row.

regards, Johan