Hi,
Very new to VBA and currently using to the below code to create a folder and pdf from one worksheet within excel.
Sub APOrderForm()
Dim myDir As String, myDirSub As String, mySht As String, c As Range
myDir = "P:" & ActiveSheet.Range("C16").Value
mySht = Range("C16").Value
On Error Resume Next
MkDir myDir
On Error GoTo 0
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=myDir & "" & mySht, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False '<---- or false
MsgBox "PO Folder and PDF Created!: " _
& vbCrLf _
& myFile
End Sub
Is it possible to code it such that I would be able to utilize multiple worksheets A & B where if i select Worksheet B to save, it would create a folder in that drive and then two sub folders for worksheet A and B and save two pdfs respectively into each sub folder.
Much help appreciated!
Very new to VBA and currently using to the below code to create a folder and pdf from one worksheet within excel.
Sub APOrderForm()
Dim myDir As String, myDirSub As String, mySht As String, c As Range
myDir = "P:" & ActiveSheet.Range("C16").Value
mySht = Range("C16").Value
On Error Resume Next
MkDir myDir
On Error GoTo 0
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=myDir & "" & mySht, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False '<---- or false
MsgBox "PO Folder and PDF Created!: " _
& vbCrLf _
& myFile
End Sub
Is it possible to code it such that I would be able to utilize multiple worksheets A & B where if i select Worksheet B to save, it would create a folder in that drive and then two sub folders for worksheet A and B and save two pdfs respectively into each sub folder.
Much help appreciated!