Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Print area composed by more range

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print area composed by more range

I always try to learn the macro and see what code excel produces. this
solves many of these type problems.

"Andrea" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Print area composed by more range


Activesheet.PageSetup.PrintArea = "$A$1:$B$2,$A$10:$B$12"


"Andrea" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Print area composed by more range

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


--
Regards,
Tom Ogilvy


"Andrea" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Area as dynamic range? Michael.Tarnowski Excel Worksheet Functions 1 March 8th 09 04:02 PM
Print area composed by more ranges Andrea Excel Discussion (Misc queries) 2 February 21st 07 07:25 PM
How to find Used Range and Print Area? Joseph Geretz Excel Programming 2 April 7th 06 04:25 AM
Print area/range Mike D. Excel Discussion (Misc queries) 2 June 30th 05 07:07 PM
Selecting a range composed of current region + 2 rows Bruce Roberson[_5_] Excel Programming 2 October 27th 04 03:00 PM


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"