Collapsing rows

G

Guest

I am writing categories of data (a category covers several rows) to an Excel
sheet, one category after another. I would like to collapse the rows
containing a category when all category data are entered. So the question is
how to programmatically collapse a number of rows after filling them with
data.

Thanks
 
G

Guest

Range("A10").Resize(8).EntireRow.Hidden = True

just to demo:

? Range("A10").Resize(8).EntireRow.Address
$10:$17


or maybe something like

ActiveCell.offset(-7,0).Resize(7).EntireRow.Hidden = True

demo'd again:
? activeCell.Address
$A$19
? ActiveCell.offset(-7,0).Resize(7).EntireRow.Address
$12:$18

so I am sitting in cell A19 after making 7 entries in cells A12:A18. Run
the macro and they are hidden and I begin the new category in A19.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top