+ Reply to Thread
Results 1 to 5 of 5

Adding to an existing macro

  1. #1
    Registered User
    Join Date
    03-26-2012
    Location
    Stevenage, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Adding to an existing macro

    I have the following Macro set up and enabled within Excel 2003, and now wish to add in to print the 3rd page. I have created a Print Copy C208 Page 3 sheet and this is all set up correctly. Any ideas on how to add printing page 3 into the macro below?:

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 03-26-2012 at 08:06 PM. Reason: code tags originally missing

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding to an existing macro

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Since you are new here I'll change it for you on this occasion but please remember for the future.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding to an existing macro

    Hi,

    Why not just

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-26-2012
    Location
    Stevenage, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Adding to an existing macro

    Thanks for this! It works a treat! The suggested Macro above is much easier than the one created by someone else several years ago.
    Sorry for not posting the code correctly!

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding to an existing macro

    Hi,

    Merely as an addendum. The code will work fine just as long as no one changes the name of a sheet, e.g. "Print Copy C208 Page 1". It's advisable to avoid hard coding sheet names in VBA code since sods law say that someone will one day change a tab name.

    It's always advisable to use the sheet code name rather than the Excel sheet name. Unless someone has changed the code name then they'll be called simply 'Sheet1', 'Sheet2', etc. So a better line of code would be

    Sheet1.PrintOut

    You'll need to determine of course what are the sheet code names for your three sheets in question.

    Regards

+ 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