Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Determining Portrait or Landscape

Excel XP & Win XP
I am helping an OP with a task that involves hiding/unhiding a variable
number of columns. When it comes time for the code to print, it will be
necessary that the code select Portrait or Landscape for the printing,
depending on the total width of the visible columns (either way, the print
range is no more than one page wide).
My question is: What would be the code to determine the location of the
first vertical page break?
Thanks for your time. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Determining Portrait or Landscape

This was obtained from the VBA Help file:

This example sets a manual page break above row 25 on Sheet1.

Worksheets("Sheet1").Rows(25).PageBreak = xlPageBreakManual

This example sets a manual page break to the left of column J on Sheet1.

Worksheets("Sheet1").Columns("J").PageBreak = xlPageBreakManual

This example deletes the two page breaks that were set in the preceding
examples.

Worksheets("Sheet1").Rows(25).PageBreak = xlPageBreakNone
Worksheets("Sheet1").Columns("J").PageBreak = xlNone

Have fun..



"Otto Moehrbach" wrote:

Excel XP & Win XP
I am helping an OP with a task that involves hiding/unhiding a variable
number of columns. When it comes time for the code to print, it will be
necessary that the code select Portrait or Landscape for the printing,
depending on the total width of the visible columns (either way, the print
range is no more than one page wide).
My question is: What would be the code to determine the location of the
first vertical page break?
Thanks for your time. Otto



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Determining Portrait or Landscape

ActiveSheet.VPageBreaks(1).Location.Address

NickHK

"Otto Moehrbach" wrote in message
...
Excel XP & Win XP
I am helping an OP with a task that involves hiding/unhiding a variable
number of columns. When it comes time for the code to print, it will be
necessary that the code select Portrait or Landscape for the printing,
depending on the total width of the visible columns (either way, the print
range is no more than one page wide).
My question is: What would be the code to determine the location of the
first vertical page break?
Thanks for your time. Otto




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing landscape and portrait Jonno Excel Discussion (Misc queries) 3 July 30th 09 04:45 PM
From portrait to landscape nelsoka Excel Worksheet Functions 2 May 23rd 09 08:46 PM
Landscape Portrait tim Excel Discussion (Misc queries) 2 March 17th 09 01:00 PM
Printing in Portrait & Landscape Peter D Excel Discussion (Misc queries) 1 August 21st 08 03:14 AM
Landscape and Portrait Phippsy Setting up and Configuration of Excel 2 January 12th 06 03:21 PM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"