I am using VBA to print to PDF school report card by cycle loop through drop-down
I want to print all report card to pdf and Split and Save PDF to Specific Folder. ( Each folder will be labeled as a Grade and contain pdf files associated with the students for that grade )
-Folders named : Grade 1, Grade 2, Grade 3, Grade 4, Grade 5
-Files named : Macro will save the file by Id number & by cycle loop through drop-down.
However, the below code just need some amendment to enable automate split the files and save into Specific folders:
Sub Print_All_To_PDF()
Dim strValidationRange As String
Dim rngValidation As Range
Dim rngDepartment As Range
Application.ScreenUpdating = False
strValidationRange = Range("B2").Validation.Formula1
Set rngValidation = Range(strValidationRange)
For Each rngDepartment In rngValidation.Cells
Range("B2").Value = rngDepartment.Value
Sheet61.Range("A1:K19").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\AKAK\Desktop\Grade 1-3\ " & Range("H1").Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Next
Application.ScreenUpdating = True
End Sub
I want to print all report card to pdf and Split and Save PDF to Specific Folder. ( Each folder will be labeled as a Grade and contain pdf files associated with the students for that grade )
-Folders named : Grade 1, Grade 2, Grade 3, Grade 4, Grade 5
-Files named : Macro will save the file by Id number & by cycle loop through drop-down.
However, the below code just need some amendment to enable automate split the files and save into Specific folders:
Sub Print_All_To_PDF()
Dim strValidationRange As String
Dim rngValidation As Range
Dim rngDepartment As Range
Application.ScreenUpdating = False
strValidationRange = Range("B2").Validation.Formula1
Set rngValidation = Range(strValidationRange)
For Each rngDepartment In rngValidation.Cells
Range("B2").Value = rngDepartment.Value
Sheet61.Range("A1:K19").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\AKAK\Desktop\Grade 1-3\ " & Range("H1").Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Next
Application.ScreenUpdating = True
End Sub