Print Delay

G

Guest

Hi,

I searched the forum for a question similar, but no luck.

I print a spreadsheet I have on a very large sheet of paper...about the size
of a poster board. Because of where the printer is, I have to set up the
printer then come back to my desk and then print the sheet. I would like to
create a VBA that would print my worksheet two minutes after I press the
button. I am not sure how to do this, but any help would be greatly
appreciated.

Thanks,
John
 
J

Jason Morin

Once you've configured all your settings to print under
File > Page Setup, copy this code into the ThisWorkbook
module. Then press your Print icon.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
TimedDelay 120 '2 minutes
End Sub
Sub TimedDelay(sec As Single)
'Harlan Grove 17-Feb-2003
Dim x As Date
x = Timer + sec
Do While Timer < x
DoEvents
Loop
End Sub

---
To copy the code above to the ThisWorkbook module, press
ALT+F11, click on the ThisWorkbook module (if you don't
see it, go to View > Project Explorer), and paste in.
Press ALT+Q to exit.

HTH
Jason
Atlanta, GA
 

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