Sub SetPrintArea()
Dim MaxRow As Long, i As Integer
MaxRow = 1
For i = 1 To 7
Cells(65536, i).End(xlUp).Select
MaxRow = Application.WorksheetFunction.Max(MaxRow, ActiveCell.Row)
Next i
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$" & MaxRow
End Sub
Sub SetPrintArea2()
Dim LastRow As Long
LastRow = ActiveSheet.Columns("A:G").Find(What:="*" _
, After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$" & LastRow
End Sub