Currently I am using the following macro to save a range as a PDF to "my documents." I would like to add a button to save the same information to a folder in OneDrive. How can I change this code to save in my OneDrive folder "2016 Summer Schedules"
Thanks for any help!!!!
Sub savetopdf()
'
' savetopdf Macro
'
Dim saveFileName As String
Dim PDFranges As Range
With ActiveSheet
saveFileName = CreateObject("WScript.Shell").SpecialFolders("MyDocuments") & .Range("T3").Value & ".pdf"
Set PDFranges = .Range("X3:AC48,AE3:AJ48,AL3:AQ48,AS3:AX48,AA59:AF104,AH59:AM104,AO59:AT104")
End With
PDFranges.ExportAsFixedFormat Type:=xlTypePDF, Filename:=saveFileName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
'
End Sub
Bookmarks