• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

setting Print area in an Excel sheet

Rajkumarmaster

New Member
Hi -

I am very passionate about VBA automation and Excel Macros.

Here is my requirement.

Let me explain my requirement with a scenario.

In my excel sheet data is between cell A1 to D240. My requirement is to select A1 to D39 and set print area, then again select A40 to D79 add this print area to the exisiting print area, then to select A80 to D119 then to add this selection to add print area.. this process need to repeat until the last line.
I created code for selecting the data, but i dont know how to set print area/add the selection to existing print area.

Please help me.

Thanks,
Rajkumar Rajan
 
Instead of adding each selection to print area, you should select all ranges that should be added to print area and then use following code.
Code:
ActiveSheet.PageSetup.PrintArea = Selection.Address
 
Back
Top