+ Reply to Thread
Results 1 to 5 of 5

Print array code for a series of pages that will also determine print area required?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Print array code for a series of pages that will also determine print area required?

    Good day all once again,

    I have print code attached to a command button which prints a series of sheets, however some of these sheets will have a changing print area, e.g. depending on how many procedures required will determine the amount of rows that need printing, is there a code that will recognise an empty cell & make that point the print area? - Thank you all & have a great day! - Marco

    Private Sub cmdPrint_Click()
    Dim ws As Worksheet
    For Each ws In Sheets(Array("PAGE 1", "PAGE 2", "PAGE 3", "Page4+", "Final Page"))
        ws.PrintOut Copies:=1
    Next ws
    End Sub

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Print array code for a series of pages that will also determine print area required?

    I believe you can NOT set a print area at all on a worksheet and it will then result in the sheet only printing the "used range".
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Print array code for a series of pages that will also determine print area required?

    Thanks for the advice Jerry, guess they will just have to adjust the print area manually then

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Print array code for a series of pages that will also determine print area required?

    That's not what I was suggesting. I was suggesting you "Clear Print Area" on each sheet, then run your macro. With no specific print area, the sheet should only print the used range on each sheet.
    Last edited by JBeaucaire; 11-05-2012 at 10:08 PM.

  5. #5
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Print array code for a series of pages that will also determine print area required?

    Hi Jerry,

    Sorry, had a blonde moment...works perfect! Have a great day! -Marco

+ 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