+ Reply to Thread
Results 1 to 6 of 6

Help adding print area code to working macro

  1. #1
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    Help adding print area code to working macro

    All,

    I have a working macro that splits out invoice lines to separate tabs and I have formatting set. I am attempting to add code for the print area. I found a working suggestion online but don't know how to incorporate within this macro so that all tabs have this page setup. Can someone assist? Thanks in advance

    Code to Add

    Please Login or Register  to view this content.

    Current Macro

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Help adding print area code to working macro

    Normally you can loop through the sheets like this,

    Please Login or Register  to view this content.
    Run the code by itself to see it work.

  3. #3
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Help adding print area code to working macro

    I'm still having issues including this in my original macro. The code below only works on the active sheet. How can I change it to include all sheets?


    Please Login or Register  to view this content.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help adding print area code to working macro

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    01-26-2016
    Location
    TX
    MS-Off Ver
    Excel 2016
    Posts
    99

    Re: Help adding print area code to working macro

    xladept - thank you! that worked great and i was able to easily add to my original macro.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help adding print area code to working macro

    You're welcome and thanks for the rep!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Private sub code no longer working (print area macro)
    By rikkyshh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2013, 10:43 AM
  2. [SOLVED] Need ‘Set Print Area’ Code for Dynamic Print Range based on Conditions
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 12:13 PM
  3. [SOLVED] Print array code for a series of pages that will also determine print area required?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2012, 11:46 PM
  4. [SOLVED] Set Print Area macro Code
    By romandotcom in forum Excel General
    Replies: 8
    Last Post: 06-21-2012, 12:09 AM
  5. Copy Paste Code not working after adding another area
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2012, 02:39 AM
  6. macro code to set print area and print
    By DrPips in forum Excel General
    Replies: 0
    Last Post: 09-06-2009, 02:36 AM
  7. Print Area:What would be the code for setting the print area
    By wammer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 02:05 AM

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