+ Reply to Thread
Results 1 to 9 of 9

Automated Dynamic Printing Area?

Hybrid View

  1. #1
    PY & Associates
    Guest

    Re: Automated Dynamic Printing Area?

    Hehe, I say "tips", but you guys do all the work!

    "smplogc" <[email protected]> wrote in
    message news:[email protected]...
    >
    > PY & Associates Wrote:
    > > You must know how many lines your print page holds;
    > > You must also be able to count the rows one way or another;
    > > then you can do what you want.

    >
    > Hehe, yup, but I don't know how to implement that in VB code or
    > whatever method would do the trick.
    >
    >
    > --
    > smplogc
    > ------------------------------------------------------------------------
    > smplogc's Profile:

    http://www.excelforum.com/member.php...o&userid=33887
    > View this thread: http://www.excelforum.com/showthread...hreadid=537072
    >




  2. #2
    Registered User
    Join Date
    04-26-2006
    Posts
    10
    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!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1