View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Erin[_6_] Erin[_6_] is offline
external usenet poster
 
Posts: 1
Default add end rows after suppressing prior rows

Hi all,
I've got a worksheet designed to do estimates (for
products). It's set-up for the largest possible number
of items included in a quote for calculation purposes.
The end users are sales people, with end viewer being the
customer.

Sheet is 102 rows, product lines run rows 15-98, totals
run lines 99-102. GOAL - automatically suppress unused
lines between rows 15-98.

I've currently got a button set-up (use me to print
nice!) for the sales people to click, which uses the
following (thank you Tom!):

Sub suppressrows()
Dim pntrng As Range

lastrow = ActiveSheet.Range("a102").End(xlUp).Row
If ActiveSheet.Name = "Estimate_test2" Then
Set pntrng = Range("a1").CurrentRegion
lastcol = pntrng.Columns.Count
Else
lastcol = 11
End If
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells
(lastrow + 1, lastcol)).Address
End Sub

This works beautifully in suppressing product line rows
not used. Problem is it also suppresses totals (pre-set
to do calculations). How can I add the info that appears
in rows 99-102 back into the printarea (moving it to the
end of the used product lines/rows)??

FYI - just suppressing all blank rows throughout document
is not an option (had a nice little macro for that!).
Moving totals to top of page is not an option either.

Seems like this should be easy, but I've spent hours
trying to figure it out. Any and all suggestions are
greatly appreciated. Thanks!!