ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Orientation Toggle (https://www.excelbanter.com/excel-programming/318910-print-orientation-toggle.html)

Alan Tolkoff

Print Orientation Toggle
 
I'm trying to write a macro that will allow me to toggle between Portrait &
Landscape modes.

I know this should be simple, but I'm missing something.

Please assist.

William[_2_]

Print Orientation Toggle
 
Hi Alan

Sub PrintToggle()
With ActiveSheet.PageSetup
If .Orientation = xlPortrait Then
..Orientation = xlLandscape
Else
..Orientation = xlPortrait
End If
End With
End Sub

--
XL2002
Regards

William



"Alan Tolkoff" <Alan
wrote in message
...
| I'm trying to write a macro that will allow me to toggle between Portrait
&
| Landscape modes.
|
| I know this should be simple, but I'm missing something.
|
| Please assist.



Gord Dibben

Print Orientation Toggle
 
Alan

Sub Toggle_Orient()
With ActiveSheet.PageSetup
If .Orientation = xlLandscape Then
.Orientation = xlPortrait
Else
.Orientation = xlLandscape
End If
End With
End Sub

Gord Dibben Excel MVP
On Mon, 13 Dec 2004 17:05:01 -0800, Alan Tolkoff <Alan
wrote:

I'm trying to write a macro that will allow me to toggle between Portrait &
Landscape modes.

I know this should be simple, but I'm missing something.

Please assist.




All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com