ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to make a form self disappear (https://www.excelbanter.com/excel-programming/346015-how-make-form-self-disappear.html)

Ben

how to make a form self disappear
 
Hi all,

I am using Excel 2002. I would like to display a form when a worksheet is
activated. But after a few seconds have elapsed, I would like the form to
unload itself. Can you please share with how I can accomplish this? Thanks.

Ben


--


Chip Pearson

how to make a form self disappear
 
In the form's code module, use

Private Sub UserForm_Initialize()
Application.OnTime Now + TimeSerial(0, 0, 5), "HideForm", ,
True
End Sub

Change the '5' to the number of seconds you want to display the
form.

In a standard code module,

Sub HideForm()
UserForm1.Hide
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Ben" wrote in message
...
Hi all,

I am using Excel 2002. I would like to display a form when a
worksheet is
activated. But after a few seconds have elapsed, I would like
the form to
unload itself. Can you please share with how I can accomplish
this? Thanks.

Ben


--





All times are GMT +1. The time now is 12:58 PM.

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