Hi
I've written a macro to allow a user to export a selection from the active sheet to PDF and to save it in a user defined location....but it doesn't work!
Can anyone help?
Thanks in advance
Sarah
Sub Save_to_PDF()
'
' Save_to_PDF Macro
'
'
Range("d1:AD103").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function
I've written a macro to allow a user to export a selection from the active sheet to PDF and to save it in a user defined location....but it doesn't work!
Can anyone help?
Thanks in advance
Sarah
Sub Save_to_PDF()
'
' Save_to_PDF Macro
'
'
Range("d1:AD103").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function