ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Load UserForm1 on sheet tab selection (https://www.excelbanter.com/excel-programming/336840-load-userform1-sheet-tab-selection.html)

Wayne_Perth_WA

Load UserForm1 on sheet tab selection
 
Does any one have any examples on how to load a userform when a sheet tab is
selected?

Not too sure as to what event would load the form....

Jim Thomlinson[_4_]

Load UserForm1 on sheet tab selection
 
You can use the activate event procedure of the worksheet. Right click on the
tab you want to load the form when it is selected. Choose View Code. This
takes you to the VBE for that sheet. Just above the code window you will see
a drop down with "General" in it. Select Worksheet instead of general. A
procedure for selection change will automatically add itself to the code
window. You can delete this as that is not the event you want. In the Drop
dow to the right of where "General" was and Worksheet is, is a drop down.
Select "Activate" from the list. The code added will run whenever the sheet
is selected, so you should end up with something like this

Private Sub Worksheet_Activate()
Userform1.show
End Sub
--
HTH...

Jim Thomlinson


"Wayne_Perth_WA" wrote:

Does any one have any examples on how to load a userform when a sheet tab is
selected?

Not too sure as to what event would load the form....



All times are GMT +1. The time now is 04:20 PM.

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