وعليكم السلام-تفضل هذا الكود على الرغم انك لم تقم برفع ملف لطلبك
CODE
Sub ExportEachSheet2PDF()[/b]
[b]Dim objWS As Worksheet[/b]
[b]Dim strFileName As String[/b]
[b]Dim strPath As String[/b]
[b]Dim strCrntWS As String[/b]
[b]strPath = ThisWorkbook.Path 'Assigned current file path[/b]
[b]strCrntWS = ActiveSheet.Name 'Assigned current sheetname[/b]
[b]Application.ScreenUpdating = False 'Disabled screen updating[/b]
[b]For Each objWS In Worksheets[/b]
[b]'objWS.Select[/b]
[b]strFileName = objWS.Name & ".pdf" 'Assigned worsksheet name as filename[/b]
[b]If VBA.Right(strPath, 1) <> Application.PathSeparator Then[/b]
[b]strPath = strPath & Application.PathSeparator[/b]
[b]End If[/b]
[b]ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _[/b]
[b]Filename:=strPath & strFileName, _[/b]
[b]Quality:=xlQualityStandard, _[/b]
[b]IncludeDocProperties:=True, _[/b]
[b]IgnorePrintAreas:=False, _[/b]
[b]OpenAfterPublish:=False[/b]
[b]Next objWS[/b]
[b]Worksheets(strCrntWS).Select 'After exporting all the worksheets, it will return to active sheet[/b]
[b]Application.ScreenUpdating = True 'Enabled screen updating[/b]
[b]MsgBox "All sheets have been exported as PDF.", vbInformation + vbOKOnly, "Exported as PDF"[/b]
[b]End Sub