I know you can select sheets and have the macro create the pdf from selected
sheets,
or..
you can hide all sheets except the ones you want to include,
create the PDF
Unhide all of the sheets.
Paul
-----------------------------------------
"Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can." - John Wesley
-----------------------------------------
________________________________
From: steven.eckley <steven.eckley@accenture.com>
To: ExcelVBA@yahoogroups.com
Sent: Mon, October 1, 2012 1:00:54 PM
Subject: [ExcelVBA] Selective PDF creation
I currently run this macro activated by a button to save my workbook as a PDF
file. The Macro works however I'd like to have only the first 7 worksheets
included in the PDF creation all the other once should be ignored.
The names of the worksheet tabs are always the same however other worksheets
change position into the first 7 and then be renamed to the standard name. the
name order is normally Summary, Cost1,Cost2,Cost3, Des1,Des2,Des3 and ver.
In the save as fumction you have a option for selection however i do not know
how to replicate this in VBA to illiminate the human interaction
Sub Save2PDF()
'
' Save2PDF Macro
'
Dim WbP As String
Dim ProjectName As String
WbP = ActiveWorkbook.Path
ProjectName = Cells(5, 6)
'
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ProjectName &
"_Report", Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=True
[Non-text portions of this message have been removed]
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar