+ Reply to Thread
Results 1 to 3 of 3

To copy printing area of one worksheet to worksheet in a different workbook

  1. #1
    Registered User
    Join Date
    06-12-2014
    Posts
    21

    To copy printing area of one worksheet to worksheet in a different workbook

    I have a macro that copies the values from one workbook to another. it copies all the formats and pastes only the values ignoring any formulas. I tried integrating the following code to make the print area of the destination file same as my source woksheet but doesn't work. Could you tell me why? I am new to excel programming and unable to figure out much. I have to d it for one more page. So incase there a simpler way to do it kindly suggest.

    Windows(GeneratorFile).Activate (Source)
    Sheets("SMOE-FRONT").Range("A1:AX90").Select
    ActiveSheet.PageSetup.PrintArea = "$A$1:$AX$90"
    ActiveSheet.Range("A1:AX90").Copy
    DestinationBook.Sheets("SMOE-FRONT").Activate(Destination)
    Sheets("SMOE-FRONT").PageSetup.PrintArea = "$A$1:$AX$90"

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

    Re: To copy printing area of one worksheet to worksheet in a different workbook

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    But your posted code just copy-pastes to the same book the same range - although you need to only specify the first range in the destination!
    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

  3. #3
    Registered User
    Join Date
    06-12-2014
    Posts
    21

    Re: To copy printing area of one worksheet to worksheet in a different workbook

    Oh Ok. i will try giving only the first range. Thank you

+ 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. Copy text from set range in one worksheet to named worksheet in another workbook
    By Steven811 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2013, 10:55 AM
  2. [SOLVED] VBA code for printing a specific area in a Worksheet
    By boela in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2013, 04:20 AM
  3. Can't fix the printing area of my worksheet!
    By niceguy21 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2013, 01:48 PM
  4. [SOLVED] Copy certain cells before save from a worksheet in one workbook to a worksheet in another
    By Marianne Rachmann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-22-2012, 07:16 PM
  5. [SOLVED] Printing selected area that includes locked cells/protected worksheet
    By kmroy0320 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 03:10 PM

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