jb
Member
Hello helpers,
I have an excel files with almost 30 sheets.
My first sheet is named menu.
On menu sheet, I have multiple sheet names from a5 to a15 (11 names are written) . for e.g. task1, task5, task7, task11 and so on.
My file contains sheets with these names.
I want vba code to be attached with button which can perform following tasks:
1. when i click on the button, my code should allow me to choose save as folder.
2. It should generate multiple separate pdf with sheet names written in cells a5 to a15
3. It should not open pdf files after creation.
I have found following code but it is not working as per my requirement.
>>> use - code <<<
I have an excel files with almost 30 sheets.
My first sheet is named menu.
On menu sheet, I have multiple sheet names from a5 to a15 (11 names are written) . for e.g. task1, task5, task7, task11 and so on.
My file contains sheets with these names.
I want vba code to be attached with button which can perform following tasks:
1. when i click on the button, my code should allow me to choose save as folder.
2. It should generate multiple separate pdf with sheet names written in cells a5 to a15
3. It should not open pdf files after creation.
I have found following code but it is not working as per my requirement.
>>> use - code <<<
Code:
Dim FName As Variant
FName = Application.GetSaveAsFilename( _
InitialFileName:=Range("a5").Value , _
FileFilter:="PDF files, *.pdf", _
Title:="Export to pdf")
If FName <> False Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FName _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End If
Last edited by a moderator: