ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close userform after 2 seconds (https://www.excelbanter.com/excel-programming/350634-close-userform-after-2-seconds.html)

kent

Close userform after 2 seconds
 
I load an userform when the workbook opens. Does anybody know some code which
automatic can unload the userform after some seconds ?

Toppers

Close userform after 2 seconds
 
Kent,
Try this:

Sub ShowForm()
UserForm1.Show vbModeless
Application.OnTime Now + TimeValue("00:00:02"), "Unload_Form"
End Sub

Sub Unload_Form()
UserForm1.Hide
End Sub

"Kent" wrote:

I load an userform when the workbook opens. Does anybody know some code which
automatic can unload the userform after some seconds ?



All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com