Try this
In a module
Option Explicit
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Public lngStartTime As Long 'time in msec
Public Sub StartTimer()
lngStartTime = timeGetTime()
End Sub
Public Function EndTimer() As Double
EndTimer = timeGetTime() - lngStartTime
End Function
Public Sub delay(msdelay As Long)
' creates delay in ms
Dim temp As Double
StartTimer
Do Until EndTimer > (msdelay)
Loop
End Sub
Function beepNow(BeepCount As Integer)
Dim N As Integer
For N = 1 To BeepCount
Beep
delay (500)
Next N
End Function
and
=IF(I2="ARCHIVE THIS!",beepNow(1),beepNow(2))
Bookmarks