Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Sub UserForm_Activate()
StartTime = Now
GenerateTheData
End Sub
Private Sub UserForm_Terminate()
If NextTime > Now Then
Application.OnTime NextTime, "GenerateTheData", , False
End If
End Sub
Option Explicit
Public StartTime, NextTime
Sub GenerateTheData()
UserForm1.TextBox1.Text = UserForm1.TextBox1.Text & _
"This data added at " & Time$ & " on " & Date$ & vbLf
If Now < StartTime + TimeValue("00:00:10") Then
NextTime = Now + TimeValue("00:00:02")
Application.OnTime NextTime, "GenerateTheData"
Else
MsgBox "Time Is Up", , "Routine Will Now End"
Unload UserForm1
End If
End Sub