Set print area for all worksheet except first two worksheets

  • Thread starter Thread starter akbnsl
  • Start date Start date
A

akbnsl

I would like to set the print area for all worksheets except the first
two worksheets equal to the range (b5:r36,b38:b83). Any suggestions
on how to do this?

Thanks
 
Sub test2()
Dim i As Long, sName As String

For i = 3 To ActiveWorkbook.Worksheets.Count
With Worksheets(i)
sName = "'" & .Name & "'!Print_Area"
.Names.Add sName, .Range("$B$5:$R$36,$B$38:$B$83")
End With
Next

End Sub

Regards,
Peter T
 

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

Back
Top