ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Cells in Print Area (https://www.excelbanter.com/excel-programming/334010-select-cells-print-area.html)

Chris Shaw

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


Sean Connolly[_3_]

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



Chris Shaw[_2_]

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



All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com