Insert CommandButton dan masukkan kode vb di bawah ini
Private Sub CommandButton1_Click()
PageSetup.PaperSize = xlPaperA4
NamaFile = Range("E94").Value
ActiveSheet.Range("A1:K160").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ThisWorkbook.Path & "\PDF\" & NamaFile, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
DoEvents
MsgBox "Sudah di simpan di PDF"
End Sub
Private Sub CommandButton1_Click()
PageSetup.PaperSize = xlPaperA4
NamaFile = Range("E94").Value
ActiveSheet.Range("A1:K160").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ThisWorkbook.Path & "\PDF\" & NamaFile, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
DoEvents
MsgBox "Sudah di simpan di PDF"
End Sub