Hey fellas,
I got some helpful people on this forum to write me a code for printing out a massive amount of commission reports a few weeks back. However it only prints about 90% of the report in alphabetical order despite the excel doc having them alphabetized. I figure it may have something to do with the printer queue not being able to keep up with how fast this code spits out print jobs for each employee.
Here is the code:
And here is an link to an example doc of what I'm working on:
https://docs.google.com/spreadsheets/d/1Yd6tLVb1bQ9WHl_-zv8o2_TGasRckZH2slr6VKD3PHY/edit?usp=sharing
I am inexperienced at coding, best I can do is alter it slightly. Is there anyway to perhaps print it all at once without sending 1000s of individual jobs? Trick is to keep each employee separated so they can receive their own commission report. Perhaps a simple code to place a page break behind "Totals Technician Name:" ?
Any advice will help!
I got some helpful people on this forum to write me a code for printing out a massive amount of commission reports a few weeks back. However it only prints about 90% of the report in alphabetical order despite the excel doc having them alphabetized. I figure it may have something to do with the printer queue not being able to keep up with how fast this code spits out print jobs for each employee.
Here is the code:
Code:
Sub printTech()Dim techStartRow As Long
Dim lastRow As Long
Dim currRow As Long
lastRow = ActiveSheet.UsedRange.Rows.Count
For currRow = 1 To lastRow
If Left(Cells(currRow, 1), 16) = "Technician Name:" Then
techStartRow = currRow
ElseIf Left(Cells(currRow, 1), 23) = "Totals Technician Name:" Then
ActiveSheet.PageSetup.PrintArea = "$A$" & techStartRow & ":$L$" & currRow
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
End If
Next
End Sub
And here is an link to an example doc of what I'm working on:
https://docs.google.com/spreadsheets/d/1Yd6tLVb1bQ9WHl_-zv8o2_TGasRckZH2slr6VKD3PHY/edit?usp=sharing
I am inexperienced at coding, best I can do is alter it slightly. Is there anyway to perhaps print it all at once without sending 1000s of individual jobs? Trick is to keep each employee separated so they can receive their own commission report. Perhaps a simple code to place a page break behind "Totals Technician Name:" ?
Any advice will help!