ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page Setup not selecting (https://www.excelbanter.com/excel-programming/330012-page-setup-not-selecting.html)

Josh O.

Page Setup not selecting
 
I have the following code in one of my macros. The code works and changes
the "Fit to " fields in the Page Setup up, but it doesn't select that I want
it to apply that way on the sheet. It changes the fit to but leaves the
"Adjust to" radio button selected. How do I have the code select the "Fit
to" option?

With Sheets(1).PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 500
End With

Tom Ogilvy

Page Setup not selecting
 
Sub AD()
With Sheets(1).PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 500
End With

End Sub

--
Regards,
Tom Ogilvy


"Josh O." wrote in message
...
I have the following code in one of my macros. The code works and changes
the "Fit to " fields in the Page Setup up, but it doesn't select that I

want
it to apply that way on the sheet. It changes the fit to but leaves the
"Adjust to" radio button selected. How do I have the code select the "Fit
to" option?

With Sheets(1).PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 500
End With




Alok

Page Setup not selecting
 
Add the following line before setting the other properties
.Zoom = False
Alok Joshi

"Josh O." wrote:

I have the following code in one of my macros. The code works and changes
the "Fit to " fields in the Page Setup up, but it doesn't select that I want
it to apply that way on the sheet. It changes the fit to but leaves the
"Adjust to" radio button selected. How do I have the code select the "Fit
to" option?

With Sheets(1).PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 500
End With


Josh O.

Page Setup not selecting
 
Thanks Tom. I knew it was something easy.

"Tom Ogilvy" wrote:

Sub AD()
With Sheets(1).PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 500
End With

End Sub

--
Regards,
Tom Ogilvy


"Josh O." wrote in message
...
I have the following code in one of my macros. The code works and changes
the "Fit to " fields in the Page Setup up, but it doesn't select that I

want
it to apply that way on the sheet. It changes the fit to but leaves the
"Adjust to" radio button selected. How do I have the code select the "Fit
to" option?

With Sheets(1).PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 500
End With






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

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