
''In um Modulo Option Explicit Sub Orario() DoEvents '''' qui il la tua rutin indirizzata al foglio da controllare con il tuo RUN Application.OnTime Now + TimeSerial(0, 0, 3), "Orario" ''ogni 3 secondi End Sub |
Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Option Explicit
Dim A_1 As Variant
Sub Orario()
DoEvents
If A_1 <> Worksheets(1).[A1] Then
If Worksheets(1).[A1] < Worksheets(1).[A21] Or Worksheets(1).[A1] > Worksheets(1).[A20] Then Call PlaySound
A_1 = Worksheets(1).[A1]
End If
Application.OnTime Now + TimeSerial(0, 0, 1), "Orario"
End Sub
Sub PlaySound()
If Application.CanPlaySounds Then
Call sndPlaySound32("c:windowsmediachimes.wav", 2)
End If
End Sub
|
Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Option Explicit
Dim A_1 As Variant
Sub Orario()
DoEvents
If A_1 <> Worksheets(1).[A1] Then
If Worksheets(1).[A1] < Worksheets(1).[A21] Then
Call PlaySound_Min
Worksheets(1).[A1].Interior.ColorIndex = 3
A_1 = Worksheets(1).[A1]
ElseIf Worksheets(1).[A1] > Worksheets(1).[A20] Then
Call PlaySound_Max
Worksheets(1).[A1].Interior.ColorIndex = 4
A_1 = Worksheets(1).[A1]
Else
Worksheets(1).[A1].Interior.ColorIndex = xlNone
A_1 = Worksheets(1).[A1]
End If
End If
Application.OnTime Now + TimeSerial(0, 0, 1), "Orario"
End Sub
Sub PlaySound_Min()
If Application.CanPlaySounds Then
Call sndPlaySound32("c:windowsmediachimes.wav", 2)
End If
End Sub
Sub PlaySound_Max()
If Application.CanPlaySounds Then
Call sndPlaySound32("c:windowsmediachord.wav", 2)
End If
End Sub
|
Private Sub mApp_SheetCalculate(ByVal Sh As Object)
If Sh.Name = Foglio1.Name And aRange.Value = aValue Then _
MsgBox "LOTTI NON AGGIORNATI E CONTROLLATI DA PIU' DI UNA SETTIMANA - CONTROLLARE ED EVENTUALMENTE AGGIORNARE ", _
vbCritical + vbOKOnly, "> CONTROLLO ED AGGIORNAMENTO LOTTI ! "
End Sub |
Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Option Explicit
Dim A_1 As Variant
Dim Spento As Boolean
Sub AVVIA_Orario()
Spento = False
Call Orario
Exit Sub
End Sub
Sub Orario()
DoEvents
If A_1 <> Worksheets(1).[A1] Then
If Worksheets(1).[A1] < Worksheets(1).[A21] Then
Call PlaySound_Min
Worksheets(1).[A1].Interior.ColorIndex = 3
A_1 = Worksheets(1).[A1]
ElseIf Worksheets(1).[A1] > Worksheets(1).[A20] Then
Call PlaySound_Max
Worksheets(1).[A1].Interior.ColorIndex = 4
A_1 = Worksheets(1).[A1]
Else
Worksheets(1).[A1].Interior.ColorIndex = xlNone
A_1 = Worksheets(1).[A1]
End If
End If
Application.OnKey "^{BREAK}", "Spegni" ''ctrl+Pausa esce dalla sub()
If Spento = True Then Exit Sub
Application.OnTime Now + TimeSerial(0, 0, 1), "Orario"
End Sub
Sub Spegni()
Spento = True
End Sub
Sub PlaySound_Min()
If Application.CanPlaySounds Then
Call sndPlaySound32("c:windowsmediachimes.wav", 2)
End If
End Sub
Sub PlaySound_Max()
If Application.CanPlaySounds Then
Call sndPlaySound32("c:windowsmediachord.wav", 2)
End If
End Sub
|
