Excel Vba Tüm Sayfaları Ayrı Ayrı PDF yapma
Excel Vba Tüm Sayfaları Ayrı Ayrı PDF yapma
Sub PdfveXlsKaydet()
'tüm sayfaları ayrı ayrı pdf yapma
targetaddr = ""
targetaddr = InputBox("PDF Kayıt Klasörü.", "Kayıt Klasör Adı")
If targetaddr = "" Then GoTo ENDE
sayfas = Application.Sheets.Count
For i = 1 To sayfas
Sheets(i).Select
With Sheets(i).PageSetup
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
'.Orientation = xlLandscape
.Orientation = xlPortrait
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
DosyaAdi = Sheets(i).Range("E24") & " - " & Sheets(i).Range("K24")
With Sheets(i)
Range("A1:L45").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=targetaddr & "" & DosyaAdi & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End With
Next
ENDE:
End Sub