Required VBA Code

charnaliaamit

New Member
Joined
Jun 15, 2012
Messages
6
Hi

I request you to please provide me a code that provide the following solution as per the below query

I am using Excel 2007, I want the code for the following sheet profile

In my work sheet their is 20 Tabs and i have to work on all this simutaneously,

In my worksheet i Insert Hyperlink on each Tab except Ist 1st Tab back to index, when i click on this hyperlink i will back to Ist Tab,
First tab i insert a hyperlink for all the other tab.

Now i want all nineteen tab become automatically hide

and when i click on hyperlink on the Ist Tab for 3rd tab, 3rd tab become visible
and when i click on hyperlink Back to index on 3rd tab, i will come on the ist tab and 3rd tab beome hide

similarly when i click on hyperlink on the Ist Tab for 15th tab, 15th tab become visible
and when i click on hyperlink Back to index on 15th tab, i will come on the ist tab and 15th tab beome hide

I need this is happened in all the 19 tab

Thanks in advance
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Soggy

Board Regular
Joined
May 16, 2012
Messages
188
The simple way is to add a few buttons rather tahn hyperlink.

So on each tab apart from tab on add a button and attach this code:

Code:
Sub Tab1()
ActiveSheet.Visible = False
Sheets("Tab1").Select
End Sub

This will hide the tab you are in and take you back to tab one.

On the main sheet create a button for each tab and attach the code:

Code:
Sub Tab5()
Sheets("Tab5").Visible = True
Sheets("Tab5").Select
End Sub

There will need to be a code for each tab and you will have to change the tab names.

You can avoid having to create 19 codes by getting a userform to pop up where it will display a list of the tabs and the user selects the tab they want. This will save you having a lot of buttons.
 

Soggy

Board Regular
Joined
May 16, 2012
Messages
188
1. Using shapes just draw a square.

2. Add the text you want so you know what the button is for.

3. Right click on the shape and select assign macro.

4. Select the macro you wish to assign.

That's it when you next left click the button it will run the macro.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,119
Messages
5,640,219
Members
417,131
Latest member
Seanr19871

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top