Having some odd print issues

Cryov

New Member
Joined
Aug 26, 2014
Messages
26
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:

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!
 
Appears to work fine after that correction.
Next time I run the mass of reports I'll message you and let you know if everything came out in correct order.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
SHG, I just did a the run and it is the same issue, its just outputting too fast to the printer and it looks like they get out of alphabetical order. I've tried that wait command and googled it some but it doesn't seem to want to function. Is there something like Application.Wait (Now + TimeValue("0:00:03")) I could try? That particular code doesn't work for some reason.
 
Upvote 0
I don't understand how they could get out of order unless the printer driver is hosed. Sure, try Wait.
 
Upvote 0
Do you have another way to code a "wait" into it? Every code I've tried doesn't work or just freezes up excel.
 
Upvote 0
Wait will indeed freeze Excel; that's what it's for.

How many pages are you printing?
 
Upvote 0
About 1200 pages total, commission reports for the whole company. If wait freezes it, is there a way to delay it 1-3 seconds before it sends the next print job to the printer?
 
Upvote 0
1200 pages -- wow. That must take a while to print with no Wait.

How about just adding page breaks and printing it all at once?
 
Upvote 0
That would be wonderful if all the commission reports were the same size. Some guys get like 10 commissions on their report and others get 200.
Is it possible to code it to put a page break right below "Totals Technician Name:" ? That is where each commission ends. If so then I could print it all at once vs sending each report individually to the printer.
 
Upvote 0

Forum statistics

Threads
1,225,060
Messages
6,182,616
Members
453,127
Latest member
IMagill

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top