View Single Post
  #3   Report Post  
daniel chen
 
Posts: n/a
Default

Hi Bob
My macro should look more like this.
Sub InputBoxTimeout()
Dim ans As Variant
ans = ""
' How do I add a time-out conponent to this? Someone please
ans = InputBox(prompt:=" Enter a number within 1 minute," & vbLf & _
" otherwise, 4 will be assumed.")
If ans = "" Then Range("A1") = 4
If ans < "" Then Range("A1") = ans
End Sub

I have never used a Userform. Please give me some hint where to start.
Thanks

"Bob Phillips" wrote in message
...
Best way is to have a little userform that you load with a textbox for
input. In the userfor activate, add this code

Application.Ontime Now + TimeSerial(0,1,0),"KillForm"

and then have a sub in a standard code mode

Public Sub KillForm()
Unload Userform1
End SUb

--

HTH

RP
(remove nothere from the email address if mailing direct)


"daniel chen" wrote in message
...
Sub InputBoxTimeout()
' How do I add a time-out conponent to this? Someone please
Range("A1") = InputBox(prompt:=" Enter a number within 1 minute," & vbLf
&

"
otherwise, 4 will be assumed.")
End Sub