+ Reply to Thread
Results 1 to 9 of 9

Move Print Area

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Move Print Area

    Hi there , I have this code that I included with my sub code but i cannot seem to get it right - all I am intending in doing is once I have copied the rows to the next available rows I want the print area to extend at the same time . The start range or cell is A1 and the code must just pick up on the last row - I do however only want the column area to be until column T or 20

    is there any one that can guide me correctly


    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Move Print Area

    Hi Chris1976,

    amybe try it like this, please change the start address for the printarea as needed:

    Please Login or Register  to view this content.
    Ciao,
    Holger

    (EDited: added point just before Cells to refer to With-Structure}
    Last edited by HaHoBe; 04-13-2021 at 08:33 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Move Print Area

    Hi Holger.
    Welcome back.
    I would change the last column line to something like this
    Please Login or Register  to view this content.
    or something like it. The Op wants to restrict the column count.

  4. #4
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Move Print Area

    Hi guys, thank you for the response/s. The code does not really extend over A - T or column 20 count. it does however move down two rows but it actually misses the 3rd row - so only extends the print area with two rows and only range "A" not A to T

  5. #5
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Move Print Area

    I have made a small change to the Range

    Please Login or Register  to view this content.
    it now expands from A to T but it still does not pick up the last row that well - I must note - could this be because there is no value in the last row "A" column - I included a picture to illustrate if that helps

    Attachment 728907

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Move Print Area

    Yes, that makes all the difference.
    To attach an example file, you have to click on "Go Advanced" at the bottom right hand side and follow the suggestions.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Move Print Area

    Re: "there is no value in the last row "A" column"
    Change your LastRow calculation to
    Please Login or Register  to view this content.
    You said you changed the 2nd line in this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    If you want to have Column T hardcoded, change the two lines into this instead.
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Move Print Area

    thanks jolivanes , that works perfectly thank you

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Move Print Area

    Glad you have it all under control.
    Good luck and thanks for letting us know that you're happy with the result.

+ 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. Set print area of selected range then print preview if ok then print the document!
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 07:10 AM
  2. Macro - Set Print Area for Changing Data Area
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-27-2013, 04:19 AM
  3. Replies: 1
    Last Post: 02-12-2013, 12:16 PM
  4. VBA to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM
  5. Replies: 8
    Last Post: 05-23-2007, 06:39 AM
  6. Replies: 4
    Last Post: 10-08-2005, 03:05 PM
  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