Sub PageTestForPrint()
Dim MyRange As Range
Dim ws As Worksheet
Dim Lastrow As Long
Dim i As Long
Dim n As Long
Dim j As Long
Dim PrintArea As String
Application.ScreenUpdating = False
Set ws = ActiveSheet
j = ActiveSheet.Index
Sheets(j + 1).Visible = True
Sheets(j + 1).Select
Debug.Print ws.Range("A1").Value
For i = 1 To 30840
If Cells(34 * i + 8, 1).Value <> "" Then
n = i + 1
Else
GoTo Printing
End If
Next i
Printing:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="Print" & (j + 1) / 2 _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Sheets(j + 1).Visible = False
Sheets(j).Select
Application.ScreenUpdating = True
End Sub