What I want is to make it simple, I think.
Using Application.OnTime VBA, I want to put (with a button) an "Yes" (only once) in a particular cell. To keep this "Yes" for 5 seconds, then to be removed.
I tried to modify but the result obtained is not what I want.
This is VBA what I think can do that.
Your opinions are welcome.
Thank you.
Using Application.OnTime VBA, I want to put (with a button) an "Yes" (only once) in a particular cell. To keep this "Yes" for 5 seconds, then to be removed.
I tried to modify but the result obtained is not what I want.
This is VBA what I think can do that.
Code:
Sub MacroAutoRun()
'Macro should be entered in a Standard Module (select Insert>Module, in code window).
Dim rTime As Date
rTime = Now + TimeValue("00:00:05")
Application.OnTime EarliestTime:=rTime, Procedure:="MacroAutoRun", schedule:=True
'Modify but the result obtained is not what I want.
Cells(1, 1).Value = "YES"
If Cells(1, 1).Value > 1 Then
Cells(1, 1).Value = ""
End If
End Sub
Thank you.