Hi VBA Gurus,,
I am using the following code to export the selected area to the PDF files
I have recorded the macro and want to add the following code and tidy up.
Please can someone club both of these codes and make them working.
Thanks in advance.
I am using the following code to export the selected area to the PDF files
VBA Code:
Sub Print PDF()
Dim i As Integer
Dim minx As Integer
Dim maxy As Integer
Dim InvNo As String
minx = Sheets("InvBCC").Range("k4").Value
maxy = Sheets("InvBCC").Range("l4").Value
InvNo = Sheets("InvBCC").Range("h14").Value
For i = minx To maxy
Range("k14").Value = i
ThisFile = Sheets("InvBCC").Range("h14").Value
ThisPath = Sheets("InvBCC").Range("n4").Value
Sheets("InvBCC").Range("C4:H35").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=ThisPath & ThisFile & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Next i
End Sub
I have recorded the macro and want to add the following code and tidy up.
VBA Code:
With ActiveSheet.PageSetup
.RightFooter = "Printed on &D at &T"
.PrintQuality = 600
.CenterHorizontally = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
End With
Please can someone club both of these codes and make them working.
Thanks in advance.