Enhancement to Tab Selection

I'd like to hide the tabs on a particular spreadsheet. When a particular industry is selected, the tab is displayed and the cursor goes to A1 in that particular tab.  The industry tab is displayed/reveailed.  Then when the sheet is "reset", all of the industry tabs are again hidden (small macro).

Sample included;

Thank you in advance,

Bright01

Simple-Tab-Selection.xlsm
Bright01Asked:
Who is Participating?
 
Curt LindstromCommented:
B,

Regarding your questions:

1) The selection tab choices in A1 was there in your original file. I just left it there as it was since I didn't know what you wanted to do with that one.

2) I'm not sure what you want. I thought the feature you wanted was to select one of the tabs and then close it (hide it) when you press the return button. Just let me know if you want it to behave in any other way. You can of course adjust this yourself as long as you understand how the macros work. There 2 macros controlling each sheet. One macro runs when the sheet is activated and the other one runs when the sheet is deactivated.


Cheers,
Curt
0
 
Curt LindstromCommented:
Try this one

Cheers,
Curt
Simple-Tab-Selection-mod1.xlsm
0
 
Bright01Author Commented:
epaclm,

Thank you for the rapid response!  The Sheet(s) work great except for one little debug error.

I get an error 91 "Object Variable, or Block Variable Not Set".  If I save it to my harddrive, I can than use it without getting the error.  Considering I'm going to be sending this to others, I was wondering if you could take a look at the error and put in the line or two that fixes that installation or first time run problem.

Much thanks,

B.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Swapnil NirmalManager, Audit AnalyticsCommented:
done..
please find attached
Simple-Tab-Selection.xlsm
0
 
Curt LindstromCommented:
B,

I cannot reproduce the error 91 "Object Variable, or Block Variable Not Set" that you get. it works for me even running directly from downloading my own uploaded version without saving.

You should always save it to your harddrive before using it anyway.

Maybe it's due to the variables not being declared in your original macro. Try this one to see if you get the error or not.

Cheers,
Curt
Simple-Tab-Selection-mod2.xlsm
0
 
Bright01Author Commented:
Curt,

Two things;

1.) If you choose "Banking" (and this is only for that choice for some reason), you get the selection tab choices in the upper left corner.
2.) The new code, does not show the tabs.  I actually like having the choice to show or not show. Can I ajust that in the code itself?

Thanks,

B.
0
 
Bright01Author Commented:
n,

I tried your code and it doesn't change to the right tab when selecting the industry.  I think Curt has this nailed with the one or two quick fixes I listed above.  However, "Thank you" for jumping in.

B.
0
 
Bright01Author Commented:
Great job Curt!

Much thanks!

B.
0
 
Bright01Author Commented:
Curt,

As I have incorporated this into my production file, I have to ask a related question.

B.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.