Solved

how to create a dynamic print area

Posted on 2014-01-10
7
453 Views
Last Modified: 2014-01-14
hi Folks
How can I create a print area in Excel 2010 to be dynamic so that when new data is added, the print area expands automatically? Thank you
0
Comment
Question by:agwalsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 200 total points
ID: 39770693
0
 
LVL 3

Assisted Solution

by:Sreeram
Sreeram earned 100 total points
ID: 39770712
HI

Using Macro also can be done

sample code:

Sub Macro1()

    With ActiveSheet.PageSetup
        .PrintArea = "$A$1:$D$" & lastinsertedrow
    End With
   
End Sub

Note:

lastinsertedrow - insert the last used row number


this code will set the print area to the range A1 to Dlastinsertedrow
0
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 200 total points
ID: 39770816
HI,

With a macro, I would rather do it like this so you have it all automatic

Sub Macro1()
    With ActiveSheet
        .PageSetup.PrintArea = .UsedRange.Address
    End With
End Sub

Open in new window

Regards
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Assisted Solution

by:yuppydu
yuppydu earned 100 total points
ID: 39775892
Why don't you simply create a variable range name and point to it?

If what you need to print is in range A1 to C40 on Sheet1 and you add items either vertically or horizontally you can name the range as PrintRange and input the following string in the Refers to:
=OFFSET(Sheet1!$A$1;0;0;COUNT(Sheet1!A:A);COUNT(Sheet1!1:1))

Then you print PrintRange
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 100 total points
ID: 39776318
Do you want the Print Area to be all rows and all columns of the Active Sheet.

If so, just delete the Print Area settings altogether and let the Automatic Print Range to kick in.

Thanks
Rob H
0
 

Author Comment

by:agwalsh
ID: 39778681
What I did in the end was a version of what was here. I set up a dummy print area and then amended the Print Range range name to read ='Name of Sheet'!$A:$A,'Name of Sheet'!$1:$2
And that actually worked well. Checked it with adding and deleting rows and it worked fine. But thank you all :-)
0
 

Author Closing Comment

by:agwalsh
ID: 39778685
I've given you all equal marks to say thank you...but I've marked RobHenson's one as best because it was the closest to what worked for me. But THANK YOU to all of you :-)
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Modification to nested formula needed 2 26
Conditional fromatting formula 29 34
Excel Formula to Iterate 4 15
Delete data based on a condition 2 7
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question