+ Reply to Thread
Results 1 to 7 of 7

Set Print Area with dynmic range in rows

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Set Print Area with dynmic range in rows

    I wants to set print area from Column A to Column M till the last used cell in column A. My data has fixed range from column A to M but rows range are not always same.

    - Abhinav
    Attached Files Attached Files
    Last edited by abhinavbinkar; 08-07-2018 at 03:22 PM.

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

    Re: Set Print Area with dynmic range in rows

    Sheets("SHEET1").PageSetup.PrintArea = Range("A1:M" & Cells(Rows.Count, 1).End(xlUp).Row).Address

  3. #3
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Set Print Area with dynmic range in rows

    Quote Originally Posted by jolivanes View Post
    Sheets("SHEET1").PageSetup.PrintArea = Range("A1:M" & Cells(Rows.Count, 1).End(xlUp).Row).Address
    Sir, One last help needed. In the same code i wants to add a new print area i.e. range $N$1:$S$18. I wants to print this range $N$1:$S$18 in the separate page after the print of my earlier range "A1:M" & Cells(Rows.Count, 1).End(xlUp).Row).Address ends.

    Please help if it is possible. Thanks.

    - Abhinav

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

    Re: Set Print Area with dynmic range in rows

    There is all kind of ways of doing that. One way would be
    Sub Maybe()
    Dim prnArr, i As Long
    prnArr = Array(Range("A1:M" & Cells(Rows.Count, 1).End(xlUp).Row), Range("N1:S18"))
        For i = LBound(prnArr) To UBound(prnArr)
            Range(prnArr(i).Address).PrintOut
        Next i
    End Sub
    You can extend the Array as much as you like/need.

  5. #5
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Set Print Area with dynmic range in rows

    Thank you so much

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

    Re: Set Print Area with dynmic range in rows

    You're welcome

  7. #7
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Set Print Area with dynmic range in rows

    Thank you Jolivanes. That worked for me.

+ 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] Set print area for a dynamic range and launch print dialog
    By BONCH in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2017, 11:37 PM
  2. how to print using combobox and make dynamic range of a print area
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2014, 07:26 AM
  3. 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
  4. Replies: 1
    Last Post: 09-05-2013, 03:32 AM
  5. [SOLVED] Need ‘Set Print Area’ Code for Dynamic Print Range based on Conditions
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 12:13 PM
  6. 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
  7. [SOLVED] Range = print area? to unhide rows.
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2006, 08:15 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