WBURKERT
Technical User
- May 28, 2010
- 73
Good Friday Morning to all the Tek-Tip guru's,
This doesn't seem to be working as expected. I am trying to set the print_area for a couple hundred spreadsheets. The code seems to make the print_area the same for all worksheets.
For s = 1 To 220
Application.StatusBar = "Setting Print Area on Section " & s
x = Worksheets("Sec" & s).UsedRange.Columns.Count
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell)
Worksheets("Sec" & s).PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
Next s
This doesn't seem to be working as expected. I am trying to set the print_area for a couple hundred spreadsheets. The code seems to make the print_area the same for all worksheets.
For s = 1 To 220
Application.StatusBar = "Setting Print Area on Section " & s
x = Worksheets("Sec" & s).UsedRange.Columns.Count
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell)
Worksheets("Sec" & s).PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
Next s