Count Print Jobs

  • Thread starter Todd Huttenstine
  • Start date
T

Todd Huttenstine

hey

Is it possible to count the number of times someone
printed something in a spreadhseet?

For instance lets say I in workbook "Test.xls" and
worksheet "Todd". Lets say I run the following code 5
times:

Worksheets("Wkly Renewals").Range("D7:F" & RngCounter +
2).PrintOut


If this is the case I need for the counter to keep track
and see this was my 5th time printing.


Thank you
Todd Huttenstine
 
F

Frank Kabel

Hi Todd
you could use the Beforeprint workbook event and store a value in your
sheet (or in a static variable)
 
T

Todd Huttenstine

How would I do that as a static variable?

-----Original Message-----
Hi Todd
you could use the Beforeprint workbook event and store a value in your
sheet (or in a static variable)

--
Regards
Frank Kabel
Frankfurt, Germany




.
 
F

Frank Kabel

Hi
using the Beforeprint event put something like the following in your
workbook module:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Static print_count
print_count = print_count + 1
MsgBox "print Job: " & print_count
End Sub

Note: This will also count the print preview

If you invoke the printing from a macro use something like the
following:

sub foo()
static print_count
Worksheets("Wkly Renewals").Range("D7:F" & RngCounter + 2).PrintOut
print_count = print_count + 1
MsgBox "print Job: " & print_count
end sub
 

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

Top