Option Explicit
Private Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" ( _
ByVal hwnd As Long, _
ByVal uIDEvent As Long) As Long
Private Function AsynInputBox _
(Prompt As String, _
Optional Title As String, _
Optional Default As String, _
Optional XPos As Variant, _
Optional YPos As Variant, _
Optional HelpFile As String, _
Optional Context As Long) As String
SetTimer Application.hwnd, 0, 1000, _
AddressOf AsynChroneousProcedure
AsynInputBox = InputBox _
(Prompt, Title, Default, XPos, YPos, HelpFile, Context)
KillTimer Application.hwnd, 0
End Function
Private Sub AsynChroneousProcedure( _
ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long)
With Range("a1").Interior
If Int(lpTimerFunc / 1000) Mod 2 = 0 Then
.ColorIndex = 3 'red
Else
.ColorIndex = xlColorIndexNone
End If
End With
End Sub
Sub Test()
Range("a1") = AsynInputBox("Enter a value in the flashing Cell 'A1'", _
"AsynChronous Standard InputBox Demo.")
Range("a1").Interior.ColorIndex = xlColorIndexNone
End Sub