Print Loop

  • Thread starter Thread starter oska
  • Start date Start date
O

oska

I wish to print a sign in sheet for staff that has information populate
from a table that contains employee info like first name, surname, em
ID, site ID etc. I have attached the spreadsheet as an example.

I want to have their details populate the sign in sheet then print th
sheet. Then populate with the next employees details and print a sig
in sheet for them, continuing on until all the employee in the lis
have a timesheet printed

Attachment filename: f v 9-1timesheet.zip
Download attachment: http://www.excelforum.com/attachment.php?postid=45693
 
Hi
This macro should loop through the rows in sheet 'staff' transfer th
values from that row to sheet 'sign in', and ask you if you want t
print it out.

I'd suggest you replace cell addresses with named ranges so the macr
will still work of you change to rows and cols etc.

delete the msgbox stage to automatically print every sheet if you'r
confident it works.


Sub printout_sheets()
n = 3
stp = False

Do While stp = False
Sheets("sign in").Range("b5").Value
Sheets("Staff").Columns(2).Rows(n).Value
Sheets("sign in").Range("b6").Value
Sheets("Staff").Columns(3).Rows(n).Value
Sheets("sign in").Range("i5").Value
Sheets("Staff").Columns(4).Rows(n).Value
Sheets("sign in").Range("i6").Value
Sheets("Staff").Columns(5).Rows(n).Value
resp = MsgBox("print this?", vbYesNo)
If resp = 6 Then Worksheets("sign in").PrintOut
n = 1 + n
If Sheets("Staff").Columns(2).Rows(n).Value = "" An
Sheets("Staff").Columns(2).Rows(n + 1).Value = "" An
Sheets("Staff").Columns(2).Rows(n + 2).Value = "" Then stp = True
Loop

End Su
 
Back
Top