ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page Formating & Macros (https://www.excelbanter.com/excel-programming/272000-re-page-formating-macros.html)

Henry[_4_]

Page Formating & Macros
 
Brad,

Try using something like:

For each Ws in ActiveWorkbook.Worksheets
With Ws
'adjust margins here
End With
Next Ws


HTH
Henry

"Brad" wrote in message
...
Hello~

I am trying to write a macro that sets the page margins
for all sheets in a workbook. Manually, if you select all
of the sheets in a workbook, then change the margins, all
the sheets change. When I run the macro, only one sheet
changes. I am using Worksheets.Select to select all
sheets, because the number & names of the sheets varies
depending on which program runs this macro. Any idea why
this works manually, but not via macro?





All times are GMT +1. The time now is 10:48 AM.

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