shahzeb123
Board Regular
- Joined
- Jul 29, 2021
- Messages
- 61
- Office Version
- 2016
- Platform
- Windows
Hi ,
Thanks guys for your previous help.
Rightnow, I am trying to save specific selected cells as pdf with set path and format.
I am trying to use below code it shows error can you guys help me out please.
Thanks guys for your previous help.
Rightnow, I am trying to save specific selected cells as pdf with set path and format.
I am trying to use below code it shows error can you guys help me out please.
VBA Code:
Dim Path As String
Path = "C:\Users\shakeelshahzeb\Desktop\Discounting\"
'Gets the name of the currently visible worksheet
Dim Filename As String
Filename = Range("D5") & "-" & Format(Date, "dd-mmm-yy")
Range("r6:y34").ExportAsFixedFormat Type:=xlTypePDF,
Range("r6:y34").SaveAs Filename:=Path & Filename & ".pdf"
'Closes the newly created workbook so you are still looking at the original workbook
ActiveWorkbook.Close