+ Reply to Thread
Results 1 to 6 of 6

Selecting multiple sheets with defined ranges

  1. #1
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Selecting multiple sheets with defined ranges

    Sheets("Sheet1").Range("A1:B29").ExportAsFixedFormat Type:=xlTypePDF, _

    In sheet 1 the Range is -


    Please Login or Register  to view this content.
    I beleive I can use UNION function here -

    Please Login or Register  to view this content.
    but not sure how to use it in this code and if this is correct! How do I get something like -

    Please Login or Register  to view this content.
    Here it is, skipping the columns C:G as desired.

    How do I get something like -

    Worksheets((("Sheet1").Range("y of Sheet1")) And (("Sheet2").Range("A1.C15")) And (("Sheet3").Range("A1.D13"))). ExportAsFixedFormat Type:=xlTypePDF, _

    Also, Sheet1 = Page 1 of PDF
    Sheet 2 = Page 2 of PDF
    Sheet 3 = Page 3 of PDF


    Regards,
    Anshul

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Selecting multiple sheets with defined ranges

    This will export non-contiguous ranges from the same sheet.
    Please Login or Register  to view this content.
    Or...
    Please Login or Register  to view this content.
    The Union function doesn't combine ranges from separate worksheets. The solution is to set the print areas on each sheet and Export As PDF the workbook.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Selecting multiple sheets with defined ranges

    @ AlphaFrog
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Selecting multiple sheets with defined ranges

    Good catch. Thanks. I just copied the addresses from the original post.

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

    Re: Selecting multiple sheets with defined ranges

    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

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

    Re: Selecting multiple sheets with defined ranges

    Duplicate Post
    Last edited by YasserKhalil; 07-26-2016 at 03:43 PM.

+ 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] selecting sheets defined in an array
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-28-2015, 01:32 AM
  2. Adding multiple sheets based on defined ranges/criteria
    By ronaldev in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2015, 05:59 AM
  3. Selecting multiple dynamic ranges.
    By VoodooChild in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2010, 08:32 AM
  4. Selecting multiple ranges
    By F6Hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2008, 02:22 AM
  5. Selecting multiple ranges
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-02-2006, 02:50 PM
  6. Replies: 4
    Last Post: 01-17-2006, 03:45 PM
  7. selecting multiple ranges
    By Helen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2005, 12:06 AM

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