|
本帖最後由 Seer_et 於 14-3-27 23:31 編輯
這是抄來的,你試試吧
Sub Alert()
Dim spath As String, cmd As String
spath = "C:\Users\Administrator\Desktop\超過100.wav"
cmd = "sndrec32 /play /close " & Chr(34) & spath & Chr(34)
Shell cmd, 6
End Sub
Sub Alert2()
Dim spath As String, cmd As String
spath = "C:\Users\Administrator\Desktop\小於100.wav"
cmd = "sndrec32 /play /close " & Chr(34) & spath & Chr(34)
Shell cmd, 6
End Sub
Sub 每隔若干秒執行()
IF Time < TimeValue("08:45:00") And Time > TimeValue("13:45:00") Then Exit Sub
With Activesheet
For Each x In .Range("R1",.Range("R1").end(xlDown))
If x > 100 Then Application.Run "Alert"
If x < 100 Then Application.Run "Alert2"
Next
End With
t = DateAdd("s",每隔若干秒,Time)
Application.OnTime t, "每隔若干秒執行"
End Sub
|
|