Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select Cells in Print Area


HOWDY!

Is there a way to select a range defined to be inside my print area?

Can you work with Pages (not Worksheets) in Excel?

I have multiple ranges that need to go to WORD as pictures, and som
are on individual worksheets and some are on the same worksheet, so
have set multiple print areas to encompass the individual ranges, an
now I want to select.copy these "pages" individually to WORD using
Loop.

Is there a way or is there a better way.

You guys are the greatest!

Have a great day,

Chri

--
Chris Sha
-----------------------------------------------------------------------
Chris Shaw's Profile: http://www.excelforum.com/member.php...fo&userid=2504
View this thread: http://www.excelforum.com/showthread.php?threadid=38566

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Select Cells in Print Area

Hi Chris,

Investigate the .PrintArea property of the PageSetup object (in Excel's VBA
help).

Will something like this below get you started ...

----------
Sub ExportPrintAreas()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
' Note: This returns a string, not a range!
If Len(wks.PageSetup.PrintArea) = 0 Then
' A print area has not been defined for this sheet (i.e. if
printing, print the whole sheet).
' Decide how you want to handle this case.
Else
Debug.Print wks.PageSetup.PrintArea
' You'll need to replace the above line and use something like
wks.Range(wks.PageSetup.PrintArea).Copy
' Insert your own code here to copy the range, open an
instance of Word and do what you need to do.
End If
Next wks
End Sub
----------

Post back again if you need to.

HTH, Sean.

"Chris Shaw" wrote:


HOWDY!

Is there a way to select a range defined to be inside my print area?

Can you work with Pages (not Worksheets) in Excel?

I have multiple ranges that need to go to WORD as pictures, and some
are on individual worksheets and some are on the same worksheet, so I
have set multiple print areas to encompass the individual ranges, and
now I want to select.copy these "pages" individually to WORD using a
Loop.

Is there a way or is there a better way.

You guys are the greatest!

Have a great day,

Chris


--
Chris Shaw
------------------------------------------------------------------------
Chris Shaw's Profile: http://www.excelforum.com/member.php...o&userid=25041
View this thread: http://www.excelforum.com/showthread...hreadid=385660


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select Cells in Print Area


Sean,

Thank you for your time and the reply. Great start!

I have problems only when I have multiple print areas on a sinlgle
worksheet. The previous code selects all the print areas, i.e. all the
pages, to copy.

Is there a way to have it only select the first page/print area of the
wks(1) to copy and then move to page2/second print area of wks(1) and
copy?

Thanks again!

- Chris


--
Chris Shaw
------------------------------------------------------------------------
Chris Shaw's Profile: http://www.excelforum.com/member.php...o&userid=25041
View this thread: http://www.excelforum.com/showthread...hreadid=385660

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
Can Excel automatically select print area on non-blank cells? N.F. Jackson[_2_] Excel Discussion (Misc queries) 1 April 3rd 09 07:03 PM
Set print area over locked cells toolman Excel Worksheet Functions 0 October 17th 08 05:04 PM
How to end/up end/across to select print area? Kevryl Excel Discussion (Misc queries) 4 October 9th 06 11:53 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Macro to select the print area Gavin[_3_] Excel Programming 5 July 29th 03 02:58 PM


All times are GMT +1. The time now is 12:11 AM.

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

About Us

"It's about Microsoft Excel"