ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print area multiple sheets (https://www.excelbanter.com/excel-programming/413591-print-area-multiple-sheets.html)

Ian Bartlett

Print area multiple sheets
 
Hello all.

I have a spreadsheet Excel 2003 with 20-40 sheets in it, this can vary.
What I would like to have happen

1. Set the print area on all sheets in the workbook
find the last row on all sheets, then set the print area there up to and
including column e
the data goes on to column w if that matters

Thanks

Ian



Mike H

Print area multiple sheets
 
Try this

Sub missive()
Dim ws As Worksheet
For x = 1 To Worksheets.Count
LastRow = Worksheets(x).Cells.SpecialCells(xlLastCell).Row
Worksheets(x).PageSetup.PrintArea = "$A$1:$E$" & LastRow
Next
End Sub

Mike

"ian bartlett" wrote:

Hello all.

I have a spreadsheet Excel 2003 with 20-40 sheets in it, this can vary.
What I would like to have happen

1. Set the print area on all sheets in the workbook
find the last row on all sheets, then set the print area there up to and
including column e
the data goes on to column w if that matters

Thanks

Ian




Ian Bartlett

Print area multiple sheets
 
That works great !!

Thanks

Ian

"ian bartlett" wrote in message
news:9VJbk.58308$Jx.19622@pd7urf1no...
Hello all.

I have a spreadsheet Excel 2003 with 20-40 sheets in it, this can vary.
What I would like to have happen

1. Set the print area on all sheets in the workbook
find the last row on all sheets, then set the print area there up to
and including column e
the data goes on to column w if that matters

Thanks

Ian






All times are GMT +1. The time now is 11:26 PM.

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