ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing during select times (https://www.excelbanter.com/excel-programming/290548-printing-during-select-times.html)

Rockee052[_28_]

Printing during select times
 
Hey,

I have a code that I did myself :) (small steps), I tried setting it u
where it would only allow the user to print during select times. M
goal was to set it up where the file could only print between 8am
Noon.. I can't figure out the code to be between certain times.

Any help will be appriciated

Private Sub Workbook_BeforePrint (Cancel As Boolean)
Select Case Time
Case Is TimeSerial(12, 0, 0)
msg = "You do not need to print at this time!"
Ans = "MsgBox(msg, vbInformation, "Cannot Print...")
Cancel = True
End Select
Exit Sub
msg = "Is the Shift Report completed and accurate?"
Ans = MsgBox(msg, vbYesNo, "About to print...")
If Ans = vbNo Then Cancel = True
End Sub


Thanks,

Rockee Freema

--
Message posted from http://www.ExcelForum.com


Rockee052[_29_]

Printing during select times
 
Me again,

Is this possible??

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com