View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Casey[_34_] Casey[_34_] is offline
external usenet poster
 
Posts: 1
Default Dynamic print area


Harley,
Try something like this. I'm not one of the experts, but this worked
for me. Adapt as necessary.

Option Explicit
Private Sub PrintArea()
Dim LngLastRow As Long

LngLastRow = ActiveSheet.Range("G65536").End(xlUp).Row
ActiveSheet.Range("A1:G" & LngLastRow).Select

With ActiveSheet.PageSetup
..PrintArea = ("A1:G" & LngLastRow)
..FitToPagesWide = 1
..FitToPagesTall = False

End With
End Sub

HTH


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=483666