sathishsusa
New Member
- Joined
- Dec 7, 2016
- Messages
- 30
Hello Experts,
I have 8 worksheet among filling form worksheet are first 3 worksheet.
when Sheet1 of Cell "AE32" is last signing part once its filled then confirm to Create the PDF first 3 worksheet ( Sheet1, Sheet2, Sheet3) and save PDF in path folder to open Dialog browse to choose location to save PDF.
Please can you help me out to solve the problems.
I have 8 worksheet among filling form worksheet are first 3 worksheet.
when Sheet1 of Cell "AE32" is last signing part once its filled then confirm to Create the PDF first 3 worksheet ( Sheet1, Sheet2, Sheet3) and save PDF in path folder to open Dialog browse to choose location to save PDF.
Please can you help me out to solve the problems.
Create PDF when Cell is Filled up
Hello Experts, I have 8 worksheet among filling form worksheet are first 3 worksheet. when Sheet1 of Cell "AE32" is last signing part once its type or filled up then confirm to Create the PDF first 3 worksheet ( Sheet1, Sheet2, Sheet3) and save PDF in path folder to open and save the file...
www.excelforum.com
VBA Code:
Option Explicit
Public Sub SaveSheetsAsPDF()
Dim wksAllSheets As Variant
Dim wksSheet1 As Worksheet
Dim strFilename As String, strFilepath As String
'Set references up-front
Set wksSheet1 = ThisWorkbook.Sheets("Sheet1")
wksAllSheets = Array("Sheet1", "Sheet2", "Sheet3")
strFilepath = "D:\My project\PTW SYSTEM"
'Create the full Filename using cells D6, E6 and F6
With wksSheet1
'Assemble the string cell-by-cell, "D6 E6-F6"
strFilename = strFilepath & .Range("A4").Value & "-" & " " & Format(Date, "dd-mmm-yyyy") & ".pdf"
End With
'Save the Array of worksheets (which will be selected) as a PDF
ThisWorkbook.Sheets(wksAllSheets).Select
wksSheet1.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=strFilename, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
'Make sure all the worksheets are NOT left selected
wksSheet1.Select
End Sub