dmcgimpsey
Active Member
- Joined
- Mar 30, 2004
- Messages
- 268
Hi Folks:
I am trying to dynamically set up a report for the end user. What I wanted to do was to set up the output to print in landscape mode, and to put page breaks at specific row numbers.
My code is below - but it seems that it is not putting in the page breaks where I wanted them -
Also - I set up the report to force the page size to 1 wide by 55 long - to ensure that it does not span across the right side of the page
Code:
Sheets("METLIFE INC").Select
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.HPageBreaks.Add Before:=Rows(72)
ActiveSheet.HPageBreaks.Add Before:=Rows(162)
ActiveSheet.HPageBreaks.Add Before:=Rows(233)
Ultimately, these lines will not be hardcoded as such -they will be set up logically but I have to at least get this to work first
Thanks in advance
Don
I am trying to dynamically set up a report for the end user. What I wanted to do was to set up the output to print in landscape mode, and to put page breaks at specific row numbers.
My code is below - but it seems that it is not putting in the page breaks where I wanted them -
Also - I set up the report to force the page size to 1 wide by 55 long - to ensure that it does not span across the right side of the page
Code:
Sheets("METLIFE INC").Select
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.HPageBreaks.Add Before:=Rows(72)
ActiveSheet.HPageBreaks.Add Before:=Rows(162)
ActiveSheet.HPageBreaks.Add Before:=Rows(233)
Ultimately, these lines will not be hardcoded as such -they will be set up logically but I have to at least get this to work first
Thanks in advance
Don