Navngive fil efter indhold af celler
Hejsa,Jeg kæmper med at få en VBA til at gemme et ark med filnavn, bestående af indholdet af flere celler.
Er det muligt at forhindre den i at overskrive en allerede eksisterende fil?
Fx ved at navngive filen med dette bag ved filnavnet (1), lige som windows selv gør.
Sub Overfør_til_PDF()
'
' Overfør_til_PDF Makro
Dim thisPath As String, docName As String
thisPath = Application.ActiveWorkbook.Path
docName = thisPath & "\TO " & Range("C4") ' HER VIL JEG GERNE HAVE FILNAVNET TIL AT BESTÅ AF FLG.: \TO "C4" " - " C6" " - " C5"
Sheets("TO dansk").Activate
' Range("C4").Select ' VED IKKE HVAD DENNE HAR AF INDVIRKNING
With Sheets("TO dansk")
.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=docName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End With
End Sub