Sub PrintALL()
'
Dim ws As Worksheet
Dim LR As Long
Dim C As Range
Dim I As Integer
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set ws = Sheets("ÝÕæá")
LR = ws.Range("T" & Rows.Count).End(3).Row
For Each C In ws.Range("T9:T" & LR)
I = I + 1
Range("P7").Value = C.Value
Range("N13").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Sub PrintPDF()
'
'
Dim ws As Worksheet
Dim LR As Long
Dim C As Range
Dim I As Integer
Dim Location As String
Dim sFolder As String
' Open the select folder prompt
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show = -1 Then ' if OK is pressed
sFolder = .SelectedItems(1)
End If
End With
If sFolder <> "" Then
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set ws = Sheets("فصول")
LR = ws.Range("T" & Rows.Count).End(3).Row
For Each C In ws.Range("T9:T" & LR)
I = I + 1
Range("P7").Value = C.Value
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFolder & "\" & I & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End If
End Sub