Help needed with inserting a print command in a loop to print a pay stub if another employee exists in the register portion of the worksheet. I have the stub set as the print area, and need this to print for each employee.
Thanks in advance
Robert Burge North Atlantic Petroleum St. John's, NF
This conversation is currently closed to new comments.
Have you though about setting up the paystub form in Word and then doing a Mail Merge? You could still do queries to print stubs that fit a particular criteria, and the stubs could be formatted more easily.
You could try using a "For Each" Loop using your register list as the range. For Example:- (Assumes register list range is in Column B with a header at "B1")
Sub Print_Loop ()
'Variable Declaration Dim TestCell as Range
'Find End Of List Range("B1").Select
If Activecell.Offset <> "" then Selection.End(xlDown).Select Else Activecell.Offset (1,0).Select End If
'Loop for each value in the Test Range For Each TestCell in Range("B2:B" & Activecell.Row)
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
payroll spreadsheet, loop to print stubs
Thanks in advance
Robert Burge
North Atlantic Petroleum
St. John's, NF