|
附件模块1里的"sub chktime"由于时间多,看起来比较凌乱。有谁能帮忙给优化一下,让其更加规范。
特别是,"启动大批1、启动大批2"需加上一条件:逢周日不执行
- Sub chktime()
- Application.ScreenUpdating = False
- '启动大批1
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "6:50" Or Format(Time, "h:mm") = "9:50" Or Format(Time, "h:mm") = "10:50" Or _
- Format(Time, "h:mm") = "13:50" Or Format(Time, "h:mm") = "17:50" Or Format(Time, "h:mm") = "19:50" Then '自动启动时间
- Call comb_Sunglass1
- End If
- '启动大批2
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "5:50" Or Format(Time, "h:mm") = "7:50" Or Format(Time, "h:mm") = "8:50" Or Format(Time, "h:mm") = "12:50" _
- Or Format(Time, "h:mm") = "14:50" Or Format(Time, "h:mm") = "15:50" Or Format(Time, "h:mm") = "18:50" Or Format(Time, "h:mm") = "20:30" Then '自动启动时间
- Call comb_Sunglass2
- End If
- '启动额外
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "5:45" Then '自动启动时间
- Call Dell_Data
- End If
- '启动额外
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "6:20" Or Format(Time, "h:mm") = "21:50" Then '自动启动时间
- Call comb_EXPICK
- End If
- '启动有色
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "12:20" Then '自动启动时间
- Call comb_Sunglass_0R
- End If
- '启动R
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "16:50" Then '自动启动时间
- Call comb_SunglassRX
- End If
- '启动TD
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "8:10" Then '自动启动时间
- Call comb_TRDAN
- End If
- '启动TC
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "10:10" Then '自动启动时间
- Call comb_TRC2AN
- End If
- '启动TM
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "10:30" Then '自动启动时间
- Call comb_TRM6AN
- End If
- '启动TBD
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "12:30" Then '自动启动时间
- Call comb_TrbTrdAN
- End If
- '启动TBCM
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "16:20" Then '自动启动时间
- Call comb_TrbTrcTrmAN
- End If
- '12:00点、17:30点、22点自动保存
- '-------------------------------------------------------------------------------------------------------------
- If Format(Time, "h:mm") = "12:00" Or Format(Time, "h:mm") = "17:30" Or Format(Time, "h:mm") = "22:00" Then '自动启动时间
- ThisWorkbook.Save '自动保存整个工作簿
- End If
-
- If CStr(Hour(Now())) = "5" And CStr(Minute(Now())) = "30" Then
- Sheet1.Range("A12").Value = 0
- End If
- Call run_Timer
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|