PIsabel
Board Regular
- Joined
- Feb 4, 2014
- Messages
- 121
- Office Version
- 365
- Platform
- Windows
I have a sheet where lines of data are pasted.
I can have a sheet with 1 , 10 or 100 lines
Then I insert formulas that summarize the information entered there to create a summary report.
I need a code that selects the print area of the two sets inserted but I need it to always be done on separate sheets.
I know that after the last line of data pasted I have an offset of 10 lines and the report lines are inserted on the 11th line and contain 15 lines.
Basically there are two printing areas that will always be printed on different sheets.
The only thing I managed to do was create a code that selected the first impression and do it separately, I didn't want to
I can have a sheet with 1 , 10 or 100 lines
Then I insert formulas that summarize the information entered there to create a summary report.
I need a code that selects the print area of the two sets inserted but I need it to always be done on separate sheets.
I know that after the last line of data pasted I have an offset of 10 lines and the report lines are inserted on the 11th line and contain 15 lines.
Basically there are two printing areas that will always be printed on different sheets.
The only thing I managed to do was create a code that selected the first impression and do it separately, I didn't want to
VBA Code:
Sub printteste()
Dim LastRow1 As Long
With ActiveSheet
LastRow1 = .Cells(.Rows.Count, "F").End(xlUp).Offset(-10).Row
.PageSetup.PrintArea = "C6:J" & LastRow1
End With
End Sub