Hi Everyone,
I have a tab with all Employee data and another tab with a template that I want to be PDF saved.
Smth similar to payslip. However, I want my VBA to give me a possibility to pick Employees from ID 1 to ID 10 (or ID 15).
I have the following VBA,
Sub PDF_All()
Sheets("Employee ALL").Select
Vrw = ActiveSheet.Range("CF10").End(xlDown).Row
For i = 10 To Vrw
Sheets("Employee ALL").Select
vemployeeID = ActiveSheet.Range("CF" & i)
Sheets("Template").Select
Set SaveRng = Range("Print_area")
Range("M2").Value = vemployeeID
pdfname = Range("P3") & Range("A8") & "_2024"
vpath = "Z:\...."
Sheets("Template").Select
SaveRng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=path & pdfname & ".pdf"
Next
MsgBox "Completed"
End Sub
but not sure where I should put, that I want to select Employees from to....
I have a tab with all Employee data and another tab with a template that I want to be PDF saved.
Smth similar to payslip. However, I want my VBA to give me a possibility to pick Employees from ID 1 to ID 10 (or ID 15).
I have the following VBA,
Sub PDF_All()
Sheets("Employee ALL").Select
Vrw = ActiveSheet.Range("CF10").End(xlDown).Row
For i = 10 To Vrw
Sheets("Employee ALL").Select
vemployeeID = ActiveSheet.Range("CF" & i)
Sheets("Template").Select
Set SaveRng = Range("Print_area")
Range("M2").Value = vemployeeID
pdfname = Range("P3") & Range("A8") & "_2024"
vpath = "Z:\...."
Sheets("Template").Select
SaveRng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=path & pdfname & ".pdf"
Next
MsgBox "Completed"
End Sub
but not sure where I should put, that I want to select Employees from to....