+ Reply to Thread
Results 1 to 2 of 2

condtional print area

  1. #1
    Registered User
    Join Date
    05-12-2011
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    1

    condtional print area

    Hello,
    I have a spreadsheet which performs partial volume calculations and displays results in increments from empty to full. So each time the program is used the last row will be in a different location - the columns are fixed. There is conditional formatting to put a bottom border the rows which contain information, the rest appear blank. I have it set to diplay a particular row on the top of each sheet, but it shows blank sheets (except for the specific row to be printed on all sheets) because it prints all rows with conditional formatting. Is there a way to do a conditional print that only prints the pages which contain data, i.e. not print cells with conditional formatting and no data. The following does not work in the print area tab, but it explains what I want to do.
    in the conditional print tab "$A$1:$H($H$5+36), i.e. the end row is is calculated from a value input into a cell.

  2. #2
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: condtional print area

    You can add some code which will work out the print area before printing.

    Place the following code in the BeforePrint event.

    1) Right click any sheet tab and select View Code
    2) In the Visual Basic Editor, in the Project box (top left), double click ThisWorkbook
    3) In the main code box (the large white area), paste the below code
    4) Make sure you update the line Set ws = Sheets("Sheet1") so it refers to the sheet you're printing

    Dion


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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