Print area multiple sheets

I

ian bartlett

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
 
M

Mike H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top