|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 ※矾风※ 于 2018-7-19 12:35 编辑
如9/30号为星期天,但是上班的(b列显示)。理应执行取消关机(不执行rng)。但是为什么依然会执行自动关机呢?请问如何修改?
Private Sub Workbook_Open()
Dim RNG, RNG2
Set RNG = [A1:A100].Find(Date, LookIn:=xlValues)‘’法定假期
Set RNG2 = [B1:B100].Find(Date, LookIn:=xlValues)‘上班’
If Not RNG Is Nothing Or Application.Weekday(Date, 2) = 6 Or Application.Weekday(Date, 2) = 7 Then Shell ("Shutdown.exe -s -t 1800")
If Not RNG2 Is Nothing Then Shell ("Shutdown.exe -a")
Set RNG = Nothing
Set RNG2 = Nothing
End Sub
|
|