I think I have the variables set up right, but I can't get the PageSetup.PrintArea right.
Here is my code:
Sub SetPrint()
' Setup Print and View 13 Month Trend
Dim EndRow As Variant
Dim TopRow As Variant
Dim NumberOfRows As Integer
NumberOfRows = Cells(Rows.Count, 1).End(xlUp).Row * -1
EndRow = Cells(Rows.Count, 1).End(xlUp).End(xlToRight).Address
TopRow = Cells(Rows.Count, 1).End(xlUp).End(xlToRight).Offset(NumberOfRows + 1, -12).Address
ActiveSheet.PageSetup.PrintArea = TopRow: EndRow
End Sub
What am I doing wrong?
Help!
Here is my code:
Sub SetPrint()
' Setup Print and View 13 Month Trend
Dim EndRow As Variant
Dim TopRow As Variant
Dim NumberOfRows As Integer
NumberOfRows = Cells(Rows.Count, 1).End(xlUp).Row * -1
EndRow = Cells(Rows.Count, 1).End(xlUp).End(xlToRight).Address
TopRow = Cells(Rows.Count, 1).End(xlUp).End(xlToRight).Offset(NumberOfRows + 1, -12).Address
ActiveSheet.PageSetup.PrintArea = TopRow: EndRow
End Sub
What am I doing wrong?
Help!