Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Klarissa Schmidt   on Jan 02 In MS Office Category.

  
Question Answered By: Mehr Malik   on Jan 02

I tried CurrentRegion but if you have lots of blank space in your region you get
the wrong answers.

I opted for the following: Thanks for the starting point

Sub SetPrintAreaAllSheets()
Dim vPrintrange As String
ReturnHome = ActiveSheet.Name 'To find your way home
For SheetIndex = 1 To ActiveWorkbook.Sheets.Count
Worksheets(SheetIndex).Select 'Have to select the sheet to set the
print area
LastCell = Sheets(SheetIndex).Cells.SpecialCells(xlLastCell).Address
'Find last cell
vPrintrange = Sheets(SheetIndex).Range(Range("A1"),
Range(LastCell)).Address 'Set your range
Sheets(SheetIndex).PageSetup.PrintArea = vPrintrange 'Set the print
range
Next SheetIndex'Next Tab
Worksheets(ReturnHome).Select ' Return to the sheet you started from
End Sub

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Print Range Or get search suggestion and latest updates.


Tagged: