Hi Andrew,
I have shown you a sample but in the original code the range is bigger where sheet1 uses employee details -sal, DOH, DOB etc for payroll.
Sheet two has an template for the payslip. I am printing the template within the loop so that tiff/payslip is created for all the employees.
I needed a change in code so that all payslips/tiffs fall under one single tiff (page after page) instead of printing multiple seperate tiffs.
i = 1
DO until sheet1.cells(i,1) <> ""
'sheet1 is the employee details
'sheet2 is a report template
sheet2.cells(i,1) = sheet1.cells(i,1)
sheet2.cells(i,2) = sheet1.cells(i,2)
sheet2.cells(i,3) = sheet1.cells(i,3)
pathwithfilename = "path" &filename &".tiff"
sheet2.range("A1:A3").printout from:=1, to:=1, copies:=1,prtofile:=true collate:=true,prtofilename:=pathwithfilename
i = i+1
loop
THanks,
Prabhu