Option Explicit
Sub Export_Worksheet_to_PDF()
Dim currentSheet As Worksheet, fname As String
fname = ActiveSheet.Range("G7").Value & ActiveSheet.Range("H5").Value '" for " & ActiveSheet.Range("H5").Value
With ThisWorkbook
Set currentSheet = .ActiveSheet
.ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\" & fname & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End With
End Sub
Sub savepdf()
Dim sPath As String, sFile As string
sPath = ThisWorkbook.Path & "\"
sFile = range("g7") & range("h5")
Activeworkbook.ExportAsFixedFormat _
Type:=x1typePDF, _
Filename:=spath & sFile, _
Quality:=xlQualityStandard, _
Includedocproperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=false
End Sub