opening user form when worksheet activated OR embedding a userform ina worksheet

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

either of these options i am open to.

i do not want the userform to open when the workbook is opened, but
rather i want it opened when the specific worksheet is activated

basically

if worksheets(1).activate then
open UF
end if

this is just the idea.
 
Rightclick on the worksheet tab that should have this behavior.

Select view code.

Paste this into the newly opened code window (usually on the right side).

Option Explicit
Private Sub Worksheet_Activate()
UserForm1.Show
End Sub

(Change the name of the userform.)

Then back to excel. Change to a different sheet, then select your sheet to
test.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top