I want a user to enter data into an Excel cell, but if the entry but doesn't finish in a given time, I want to stop entry at that timeout, enter into the cell what ever has been typed up until that time.
Update
I tried the below code now but this does not work. It does not close the form or timeout.
Sub Button1_Click()
Dim PauseTime, StartTime
On Error Resume Next
UserForm1.Show
' Set duration in seconds
PauseTime = 5
' Set start time
StartTime = Timer
Do While Timer < StartTime + PauseTime
DoEvents ' Yield to other processes
Loop
ActiveCell.Value = UserForm1.TextBox1.Value
Unload UserForm1 ' close the form
End Sub