Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
HI,
What would be the correct way to use a time serial between two time. I need to set it up where the time are equivalent to everything after 8am - Noon.. I have tried this Case Is < TimeSerial(13, 0, 0) & TimeSerial(7, 0, 0) I don't think this is right? Thanks Rockee Freeman --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
One way:
Case TimeSerial(8, 0, 0) To TimeSerial(12, 0, 0) would include both 8:00 and 12:00 Case TimeSerial(8, 0, 1) To TimeSerial(11, 59, 59) would exclude both 8:00 and 12:00 In article , Rockee052 wrote: HI, What would be the correct way to use a time serial between two time. I need to set it up where the time are equivalent to everything after 8am - Noon.. I have tried this Case Is < TimeSerial(13, 0, 0) & TimeSerial(7, 0, 0) I don't think this is right? Thanks Rockee Freeman --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
JE or Anyone,
This is my code: Private Sub Workbook_BeforePrint(Cancel As Boolean) Select Case Time Case Is < TimeSerial(13, 0, 0) & TimeSerial(8, 0, 0) Beep 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 Labor Report completed and accurate?" Ans = MsgBox(msg, vbYesNo, "About to print...") If Ans = vbNo Then Cancel = True End Sub I tried putting in: Case TimeSerial(8, 0, 1) To TimeSerial(11, 59, 59) I received an error, what do I need to change to get my code workin correctly... What I'm trying do is stop some employees from printing a report out anytime after 8am-Noon... Thanks Rockee Freema -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Select Case Time Case TimeSerial(8, 0, 0) To TimeSerial(12, 0, 0) Beep msg = "You do not need to print at this time!" Ans = MsgBox(msg, vbInformation, "Cannot Print...") Cancel = True Exit Sub Case Else msg = "Is the Shift Labor Report completed and accurate?" Ans = MsgBox(msg, vbYesNo, "About to print...") If Ans = vbNo Then Cancel = True End Select End Sub Worked for me. -- Regards, Tom Ogilvy Rockee052 wrote in message ... JE or Anyone, This is my code: Private Sub Workbook_BeforePrint(Cancel As Boolean) Select Case Time Case Is < TimeSerial(13, 0, 0) & TimeSerial(8, 0, 0) Beep 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 Labor Report completed and accurate?" Ans = MsgBox(msg, vbYesNo, "About to print...") If Ans = vbNo Then Cancel = True End Sub I tried putting in: Case TimeSerial(8, 0, 1) To TimeSerial(11, 59, 59) I received an error, what do I need to change to get my code working correctly... What I'm trying do is stop some employees from printing a report out anytime after 8am-Noon... Thanks Rockee Freeman --- Message posted from http://www.ExcelForum.com/ |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
TimeSerial
Tom,
When I adjusted the code I put: Case Is Instead of Case (whoops) Thanks, Rockee Freema -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|