Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can Excel automatically select print area on non-blank cells? | Excel Discussion (Misc queries) | |||
Set print area over locked cells | Excel Worksheet Functions | |||
How to end/up end/across to select print area? | Excel Discussion (Misc queries) | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
Macro to select the print area | Excel Programming |