View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
smplogc
 
Posts: n/a
Default Automated Dynamic Printing Area?


This is the best solution I could find on my own. It's not my code, of
course - I don't know VB, but I'm starting to understand it.

Sub Hide_Print_Unhide()
Dim rw As Long
Application.ScreenUpdating = False

With Sheets("Sheet1")
For rw = 33 To 111
If Application.WorksheetFunction.CountA( _
.Cells(rw, 1).Range("A1:F1")) = 0 Then _
.Rows(rw).Hidden = True
Next rw
.PrintOut ' for testing use .PrintPreview
.Range("A33:A111").EntireRow.Hidden = False
End With

Application.ScreenUpdating = True
End Sub


- rows 1-11 are header text and column headings that appear on every
page
- rows 12-32 are the minimum number of data rows that appear on the
first page
- rows 33-111 are additional rows that will only print if they contain
any data
- rows 112-115 will always print underneath whatever number of data
rows are printed (from 21 to 100)

My ragtag abomination of a spreadsheet is coming to life!


--
smplogc
------------------------------------------------------------------------
smplogc's Profile: http://www.excelforum.com/member.php...o&userid=33887
View this thread: http://www.excelforum.com/showthread...hreadid=537072