LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Expand/Collapse Rows

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rows & Columns in Excel seadragon69 Excel Worksheet Functions 2 December 7th 05 05:54 PM
Automatically inserting rows ausdiver99 Excel Worksheet Functions 1 June 2nd 05 02:15 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
Insert rows Mr. G. Excel Worksheet Functions 3 March 31st 05 03:49 AM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"