我正在构建一个VBA来保存excel表格作为PDF,我正在尝试根据一些变量保存文件名,即时通讯虽然有点功能但请有人指点我去哪里拧请:
pdfName = ActiveSheet.Name
ChDir ActiveWorkbook.Path & "\"
fileSaveName = ActiveSheet.Name & Range("A3:Q3").Text & Range("Q3").Text & Date("ddmmyyyy").Text .PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
fileSaveName _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
MsgBox "File Saved " & " " & fileSaveName
答案 0 :(得分:0)
如果在同一张表中尝试
With ActiveSheet
fileSaveName = .Name & .Range("A3:Q3").Text & .Range("Q3").Text & Format$(Now,"ddmmyyyy")
End With