Bob:
Sorry, I am looking around for ideas to solve a problem and this thread
seems to be related. Is there any way to code the following issue?
I have different worksheets in an XL 2002 file that I want to print in
tandem with a macro. I need to reset all possible page breaks and then set
the same print area for all of them. I can select all worksheets change the
page setup properties for Page, Margins and Headers/Footers, but I can't get
access to the options in the Sheet tab related to area and titles. Similarly
I can't get to do anything about the Page Breaks. Can you help me? This is
part of my code and I don't know what I am doing wrong.
Worksheets(Array("E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8")).Select
SelectedSheets.ResetAllPageBreaks
SelectedSheets.PageSetup.PrintArea = "$G$13:$BE$242"
Range("G93").Select
SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Range("X13").Select
SelectedSheets.VPageBreaks.Add Before:=ActiveCell
With SelectedSheets.PageSetup
.PrintTitleRows = "$1:$12"
.PrintTitleColumns = "$A:$F"
End with
You would really make my week if you have any suggestions.
Thanks
Roy
Bob Kilmer said:
Suggestion: Record a macro while setting the print area, then examine and
adapt the code. You'll get something like this:
ActiveSheet.PageSetup.PrintArea = "$B$1:$B$36"
To be specific about which workbook and worksheet you are setting the print
area for, you might use
Workbooks("Book1.xls").Worksheets("Sheet1").PageSetup.PrintArea =
"$B$1:$B$36"
where you replace Book1.xls and Sheet1 with your own workbook and sheet
names.
"$B$1:$B$36" can be replaced with any statement that returns a range
address; e.g., Range(Cells(1,1),Cells(2,2)).Address
Regards,
Bob