Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Open a UserForm when a Tab is selected

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Open a UserForm when a Tab is selected

Put the commands in the sheet's Worksheet_activate / Worksheet_deactivate
events, ot in the workbook's SheetActivate / SheetDeactivate events.

HTH. Best wishes Harald


"SJW_OST" wrote in message
...
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Open a UserForm when a Tab is selected

That works great!
The only problem I have now is I have macros that constantly activate the
TAB I want that userform to auto-populate on when activated/clicked on. I
tried putting "UserForm.Hide" command just behind each call of the sheet in
the various macros but it did not make the userform stay hidden for the
duration of the other macro(s) run, so the userform is intrupting the run of
the other macros. Unless you have something that is code based, I think I'll
just tie the userform to a button on the sheet. Any thoughts?
Otherwise what you gave worked as I initially wanted. Thanks again.

"Harald Staff" wrote:

Put the commands in the sheet's Worksheet_activate / Worksheet_deactivate
events, ot in the workbook's SheetActivate / SheetDeactivate events.

HTH. Best wishes Harald


"SJW_OST" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Open a UserForm when a Tab is selected

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

"SJW_OST" wrote in message
...
That works great!
The only problem I have now is I have macros that constantly activate the
TAB I want that userform to auto-populate on when activated/clicked on. I
tried putting "UserForm.Hide" command just behind each call of the sheet
in
the various macros but it did not make the userform stay hidden for the
duration of the other macro(s) run, so the userform is intrupting the run
of
the other macros. Unless you have something that is code based, I think
I'll
just tie the userform to a button on the sheet. Any thoughts?
Otherwise what you gave worked as I initially wanted. Thanks again.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you make a userform open automatically when you open excel? Evan Excel Worksheet Functions 1 March 11th 10 02:24 AM
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Listbox has some items selected when userform containing it opens. Tom Excel Programming 4 June 26th 07 05:26 AM
changing selected label on userform w/ a variable mike k Excel Programming 1 February 19th 04 01:48 AM
tabbing round a userform, whole field is selected Mike[_49_] Excel Programming 3 October 26th 03 11:29 PM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"