Hi guys,
I want to use the double click event on my worksheet to hide certain rows in Column B.
The user is to double click on a colour index = 2 cell, If they double click on anything but then the sub exits
Once the statement above proves true then the macro needs to find the 'top' of the colour index = 2 range that the user double clicked in. This is identified by finding the first cell above the clicked cell that has colour index = 2 and a top border.
Next is to find the first 'bottom' cell below the found 'top' cell that has no colour index (i.e. no fill) and has a bottom Border.
The macro then hides all the rows between 'top'.Row and 'bottom'.Row, except for the top row.
Then if the user double clicks on the now only visible 'top' row then the range below it unhides. This is identified by determining whether top.Row > range(top).offset(1,0).row > 1 (indicating that between these 2 rows there are hidden rows)
So far i have:
But i dont have any measure for determining the last range to hide (as there is no bottom border on the last range). Without having to manually put in a bottom border i was hoping to include an OR statement into the last do loop that looks for Cells(nRow + i, 2).Borders(xlEdgeBRight).LineStyle <> xlContinuous. This row identifies that last row to be hidden at the bottom of the range.
Also i have not yet got a way of unhiding the hidden rows as mentioned above
Any help in these 2 problems would be much appreciated
Regards
Bookmarks