Excel Personal workbook macro to save as pdf in current directory
I want to record macro in personal workbook for the following.
1. Activate Book1.xlsx 2. Select sheets Sheet3, Sheet4 and Sheet6 3. Save these selected sheets as .pdf in the same directory where Book1.xls is saved 4. Name of the saved .pdf file should be the name what is written in Range A1 of Sheet1 of Book1.xlsx and suffix "20" after the name
Thank you for the opportunity to help you with your question!
Put this code in the personal workbook:
'workbook Book1.xlsx must already be open
'and it must have already been saved to disk
'so that it contains file path information as
'part of its name.
'That workbook must have sheets named
'Sheet1, Sheet3, Sheet4 and Sheet6 in it.
'Sheet1 must have a valid filename in cell A1.
Dim FilePath As String
Dim NewName As String