save selected range as PDF in specific folder with filename based on a cell value.

Описание к видео save selected range as PDF in specific folder with filename based on a cell value.

Hello Friends! In this video we will learn how to save selected range of cells as PDF in specific folder with filename based on a cell value. So, that whenever you make changes to the cell. your file will be saved with filename based on that particular cell value.

Sub mypdf()
Dim a As String
Dim b As String
Sheets("Sheet2").Activate
a = Sheets("Sheet2").Range("G3")
b = "E:\PDF\"


Sheets("Sheet2").Range("C5:F12").ExportAsFixedFormat Type:=xlTypePDF, filename:= _
b & a & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub

Комментарии

Информация по комментариям в разработке