Print area composed by more range

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

Hi all,
I know how to set a print area composed by two (or more) areas; i.e. I
select range A1:B2 and then (with CTRL pressed) select A10:B12, so my print
area is composed by two range.
How can I do this with a macro?
Thanks in advance
JFM
 
I always try to learn the macro and see what code excel produces. this
solves many of these type problems.
 
I think Joel is trying to tell you that you can get this code by turning on
the macro recorder (tools=>Macro=>Record a new macro) then performing the
action manually. Then turn off the macro recorder and look at the code
recorded. In this case:

Sub Macro1()
Range("A1:D15,F19:J31").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$D$15,$F$19:$J$31"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top