First i am creating pdf files from excel format sheet and it is getting save in one folder .......
1)If pdf file in folder is more than 30 then it should merge all pdf files into one pdf file
can anybody suggest how to do this using vba ?
I did below Code:
Sub CreatePdf_form()
Dim str AS String
Dim strFile As String
Dim strMyPath As String
Sheets("data").select
Range("A2").Select
str=Activecell.value
strMyPath=Activeworkbook.Path
chDir strMyPath
If Len(Dir(StrMyPath & "\" & "Form", vbDirectory))=0 Then
MkDir strMyPath & "\" & "Form"
End If
sheets("data").select
Activesheet.ExportASFixedFormat Type:=xlTypepdf, Filename:=strMypath & "\" & "Form" & "\" & strFile & ".pdf"
End sub
1)If pdf file in folder is more than 30 then it should merge all pdf files into one pdf file
can anybody suggest how to do this using vba ?
I did below Code:
Sub CreatePdf_form()
Dim str AS String
Dim strFile As String
Dim strMyPath As String
Sheets("data").select
Range("A2").Select
str=Activecell.value
strMyPath=Activeworkbook.Path
chDir strMyPath
If Len(Dir(StrMyPath & "\" & "Form", vbDirectory))=0 Then
MkDir strMyPath & "\" & "Form"
End If
sheets("data").select
Activesheet.ExportASFixedFormat Type:=xlTypepdf, Filename:=strMypath & "\" & "Form" & "\" & strFile & ".pdf"
End sub