+ Reply to Thread
Results 1 to 3 of 3

Setting print area on exported sheet help

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Setting print area on exported sheet help

    I have a sheet that gets exported and depending on a response to input box from user I want the print area to reflect a certain range on the exported sheet.

    Please Login or Register  to view this content.
    If the repsonse answer "RunNo" is between 1-9 then I want the print area set as follows

    if RunNo 1-9
    ActiveSheet.PageSetup.PrintArea = "$A$1:$k$56"

    if RunNo 10-18
    ActiveSheet.PageSetup.PrintArea = "$A$58:$k$113"

    if RunNo 11-27
    ActiveSheet.PageSetup.PrintArea = "$A$115:$k$170"

    if RunNo 28-36
    ActiveSheet.PageSetup.PrintArea = "$A$172:$k$227"

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Setting print area on exported sheet help

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    See in the VBA inner help If … Then … ElseIf … Else … End If or Select Case block statements …

+ 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] Setting Print area with VBA code on active sheet - Can't get my code to work
    By hans302 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2017, 05:07 AM
  2. Setting print area by vba
    By wayneao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2014, 12:12 PM
  3. Setting a print area in vba
    By harveywalker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2012, 10:47 AM
  4. Setting print area
    By mridzuan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2007, 04:58 AM
  5. Setting The Print Area
    By beans_21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2006, 05:32 AM
  6. setting a print area
    By Matilda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2005, 03:50 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