Print Loop

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
 
N

Nicky

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Create timesheet for multiple users 1
How do I report this please?? 10
Counting dates within groups 2
Lookup value help 5
How to separate data.... 1
ordering 3
Match and lookup data 2
Time Sheet Calculations 4

Top