Hi,
I have this code that saves and open a single sheet from exel workbook to a PDF file (report). When it get saved it automatic gives a name to the file such as TTS-1, and next time saved TTS-2.
Is there anything I can do to the code that saves this filename in a cell in the worksheet as my reportnumber.
This is the code that I use.
Private Sub CommandButton2_Click()
Static FileCount As Long
Ark5.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Oystein\Desktop\BTF\Hovedprosjekt\Exel prosjekt\Rapport\TTS-" & FileCount + 1 & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
FileCount = FileCount + 1
End Sub
Thanks in advance
Oeysbrei
Bookmarks