![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Las Vegas Nevada USA
Posts: 240
|
I recorded a Macro to adjust the page breaks.
Sub Macro2() ' Macro2 Macro ActiveWindow.SelectedSheets.PrintPreview ActiveSheet.PageSetup.PrintArea = "$A$1:$H$25" ActiveWindow.SelectedSheets.PrintPreview End Sub Try to run it and it stops at the Print Preview window. Click Page Break Preview and it continues and does the adjustment then goes back to Print Preview. You have to click on Normal View to get it to finish. What do you have to do to get to run all the way through??? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
|
I'm not sure I understand the question. What is it exactly that you want to do? There are so many print settings in Excel that it's rarely necessary to set the print area unless you *must* keep other data on the same worksheet.
Could you give more detail? Thanks!
__________________
~Anne Troy |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Las Vegas Nevada USA
Posts: 240
|
I have a workbook with a sheet that gets copied many times. Somhow the print area got screwed up before I noticed. I don't want to go through the effort of manually adjusting every sheet if a Macro will do it. Any solutions??
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
|
I guess I don't understand the point of print preview at all. Just take both of those lines out of your code and just use the print area line.
__________________
~Anne Troy |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Las Vegas Nevada USA
Posts: 240
|
Hey thanks Dreamboat. It works great. The Macro recorder put the print preview in and I didn't realize it was not necessary. Thanks again.
George |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|