PDA

View Full Version : VBA 2010 create PDF from multiple sheets



Flightcase
05-04-2013, 05:09 AM
Hi everyone, with the code below I can make a PDF of 1 active sheet, but how can I command the code to NOT make a PDF of the page where for example cells C9,L9,U9,AD9,E249,N249,W249,AF249,AO249 are blanc? This are specific cells on each page (VpageBreaks) of the active sheet. This was easy to ask :-) :-) . Thanks for answering!!

[vba]
Sub PDF()
Thisworkbook.Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Thisworkbook.Path & "\Path\" & Range("C1").Value & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Thisworkbook.Activate
Thisworkbook.Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Deselect
End Sub
[vba]

I tried to deselect again the active workbook sheets becouse that causes dangerous situations :-( although this is not working propperly :-( I should find the solution to skip the PDF of blanc worksheets. (based on cell references) this code is actually making the PDF BUT it is damaging the buttons of my active workbook! :dunno

Flightcase
05-05-2013, 02:39 AM
:whistle: no one is challeged enough?? :help

Aussiebear
05-23-2013, 12:28 AM
Perhaps of it is posted in the correct forum then it will be responded to.