Hello all. How can I amend the below code to check for a duplicate file in the save folder and prompt me to overwrite the file or to change the name? Should the file name being created not exist the code just needs to continue running as it does now.
Thanks in advance.
Tim
>>> use code - tags <<<
Thanks in advance.
Tim
>>> use code - tags <<<
Code:
Sub SaveAsPDF()
'Saves active worksheet as pdf using concatenation
'of A1,A2,A3
Dim fName As String
With ActiveSheet
fName = .Range("A1").Value & .Range("A2").Value & .Range("A3").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\My Documents\" & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End With
End Sub
Last edited by a moderator: