Friday 12 June 2020

Save as PDF in Excel using VBA || Export As PDF from Excel || Excel to P...

                  VBA CODE
Sub saveaspdf()
Dim sh As Worksheet
Set sh = Sheets("Sheet1")
Dim myfile As String
myfile = "C:\New folder\" & sh.Range("D4") & ".pdf"
sh.Range("B3:J23").ExportAsFixedFormat xlTypePDF, myfile, , , , , , openafterpublish:=True
End Sub 

Click here to download this file..

2 comments:

  1. madhu14882@gmail.com

    Please send this file

    ReplyDelete
  2. Please Create Code for Long columns like "B2:P32"

    ReplyDelete