Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi, I am writing a macro to expand/collapse a group of rows.
Requirement: The excel sheet contains test cases. The test cases are grouped into different categories. For easy viewing of the test cases, I need to collapse the entire category of test cases. The category name comes first on a separate row followed by several rows of test cases - test cases can be any number and people can keep on adding/removing cases. I have put small buttons with names '+', '-' and mapped to macros to hide and unhide rows. This works well (See macros HideR, UnhideR below) The problem: I dont want to hardcode the row numbers as the row numbers can keep on changing. I am mainly creating a test cases template which will be used by others. They should not go about editing macros. Their job is just to add/modify test cases and the +, - buttons should still work. I have thought of the following solution, but I am not sure how to go about implementing this and need help here. The macro could collapse all the rows from the current row/cell (where the buttons are located) until a fixed pattern is matched (say, "END SECTION"). The buttons can then be placed on the same row as the category header. At the end of the section the "END SECTION" will be placed. Rows can be added/deleted in between and the macros would still work. Is this possible? cheers, Girish ---------------------------------------------------------------------------------- Sub HideR() Rows("6:13").Select Selection.EntireRow.Hidden = True End Sub Sub UnhideR() Rows("6:13").Select Selection.EntireRow.Hidden = False End Sub ---------------------------------------------------------------------------------- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rows & Columns in Excel | Excel Worksheet Functions | |||
Automatically inserting rows | Excel Worksheet Functions | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) | |||
Insert rows | Excel Worksheet Functions | |||
flexible paste rows function that inserts the right number of rows | Excel Discussion (Misc queries) |