+ Reply to Thread
Results 1 to 9 of 9

Print Area Macro - Incorrect range selected.

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Question Print Area Macro - Incorrect range selected.

    Hi there,

    having a small issue with a VBA for setting a print area on a worksheet.
    the code works fine, there are no compile errors, however the area selected is not the range coded for -

    Capture3.PNG
    Capture4.PNG

    Any ideas why this is happening?


  2. #2
    Registered User
    Join Date
    04-18-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Print Area Macro - Incorrect range selected.

    Have realised that it is selecting the cells, but is not setting them as the print area. Is there a command I need to add into the macro?

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    || Print Area Macro. ||

    Hi there,
    I'm currently making a VBA that will set the print area to a certain range of cells. The macro is fine and running well, however the cells selected are only being selected and not set as the print area.
    Not too sure how to rectify the code as I'm with little VBA experience.

    Any ideas what I can do to set a print area?
    Cells are E2:L50 and always will be.


    Images to help if I'm not very clear.

    Capture3.PNG
    Capture4.PNG

    Current code -

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 05-13-2013 at 06:06 AM. Reason: added CODE tags

  4. #4
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Print Area Macro - Incorrect range selected.

    Try this....

    Please Login or Register  to view this content.
    Last edited by abduljaleel.mca; 05-13-2013 at 06:14 AM.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Print Area Macro - Incorrect range selected.

    I reckon you want
    Please Login or Register  to view this content.
    rather than
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: || Print Area Macro. ||

    I think you have a typo in your code - you are setting the print area to AE2 not E2!

    Please Login or Register  to view this content.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Print Area Macro - Incorrect range selected.

    jpoppet,

    I have merged your threads - please post a question once only. Please also use CODE tags around your VBA - makes it easier for others to read etc - I have added on this occasion.

  8. #8
    Registered User
    Join Date
    04-18-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Print Area Macro - Incorrect range selected.

    Sorry, will give the forum rules a wash-over!
    Many thanks, yes you are right I think it's a typo; monday mornings...(!)
    Is there a macro I can use that will then PRINT the page?

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Print Area Macro - Incorrect range selected.

    Please Login or Register  to view this content.
    :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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