Hi,
The following code creates print preview for each row. But someone please help me to save as pdf instead of print preview.
There are list of employees and details in data sheet. Payslip generates and show print preview for each employee when you run this code. But instead of print, I need to save payslip for each employee in their name separately
>>> use code - tags <<<
The following code creates print preview for each row. But someone please help me to save as pdf instead of print preview.
There are list of employees and details in data sheet. Payslip generates and show print preview for each employee when you run this code. But instead of print, I need to save payslip for each employee in their name separately
>>> use code - tags <<<
Code:
Sub SavePaySlips()
Dim rCl As Range
Dim rRng As Range
With Sheet1
Set rRng = .Range(.Cells(6, 1), .Cells(.Rows.Count, 1).End(xlUp))
For Each rCl In rRng
With Sheet16
.Cells(6, 2).Value = rCl.Value
.PrintPreview
End With
Next rCl
End With
End Sub
Last edited by a moderator: