tags:

views:

111

answers:

1

In excel (2003), I have a list of items on one page that my estimator can select from, and then on the invoice it prints the items selected....but I don't want blank lines for the items not selected. How do I get either the empty row height to be 0, or have the rows without data collapse. Is this possible.

+1  A: 

You can set the RowHeight property programmatically in Excel.

For example you might loop over a range of rows and alter the RowHeight:

Dim row As Range
For Each row In ActiveWorkbook.Worksheets("Sheet1").Range("10:20").Rows
    row.RowHeight = 0
Next

Or perform some conditional evaluation:

Dim row As Range
For Each row In ActiveWorkbook.Worksheets("Sheet1").Range("10:20").Rows
    If row.Cells(1, 2).Value = 10 Then row.RowHeight = 0
Next

Or delete the row:

row.Delete
Lawrence P. Kelley