ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   activate userform when a worksheet tab is selected (https://www.excelbanter.com/excel-programming/428224-activate-userform-when-worksheet-tab-selected.html)

James

activate userform when a worksheet tab is selected
 
Hello,

How do I automatically activate a userform when a user selects a specific
worksheet tab? What's the code for that?

Thank you

Nigel[_2_]

activate userform when a worksheet tab is selected
 
Place code on the Workbook code page

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Sheet1" Then
UserForm1.Show
End If
End Sub

--

Regards,
Nigel




"James" wrote in message
...
Hello,

How do I automatically activate a userform when a user selects a specific
worksheet tab? What's the code for that?

Thank you




All times are GMT +1. The time now is 06:29 AM.

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