Excel VBA Tip: Add Button to Your Macro (Alternative Options)

Excel VBA Tip: Add Button to Your Macro (Alternative Options)
💥Subscribe: / @greggowaffles
Code:
Sub save_range_as_pdf()
Dim pdf_range As Range
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
Set pdf_range = ws.Range("B2:C14")
ws.PageSetup.CenterHorizontally = True
pdf_range.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Users\greggowaffles\Documents\" & _
"KZread Videos\Test\Cookie Sales Reports\" & _
"Cookie Sales Report " & _
ws.Range("B11").Text & ".pdf", OpenAfterPublish:=True
End Sub
#excelmacro #excelvba

Пікірлер