Open a UserForm when a Tab is selected

  • Thread starter Thread starter SJW_OST
  • Start date Start date
S

SJW_OST

I would be most appreciative if someone can help me with this.
I have a user form that I want to show when a TAB, Sheet1, is selected then
hide again when ANY other TAB, Sheet2, Sheet3, etc..., is selected. I've seen
similar posting to do this when a cell is selected but I could not get them
to work when a TAB is selected.
Thank you in advance.
 
Put the commands in the sheet's Worksheet_activate / Worksheet_deactivate
events, ot in the workbook's SheetActivate / SheetDeactivate events.

HTH. Best wishes Harald
 
Hi

Is it so that your code selects a sheet to do something there ? Selection by
code is almost never necessary, you can work there by addressing it
directly, like
Sheets("Sheet12").Range("A1:C14").Clear

Best wishes Harald
 

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