button to go to specific tab


V

vdmbqb

I have an excel 2003 spread sheet with 309 sheets. I want to create a button
on each sheet that when clicked will bring me back to sheet 1.

Thank you so much in advance.
 
Ad

Advertisements

L

Lars-Åke Aspelin

I have an excel 2003 spread sheet with 309 sheets. I want to create a button
on each sheet that when clicked will bring me back to sheet 1.

Thank you so much in advance.

Create the button and connect the following code to it:

Sub Button1_Click()
Worksheets("Sheet1").Activate
End Sub

Hope this helps / Lars-Åke
 
B

BobT

First, let's record a macro of what you want to do (TOOLS | MACRO | RECORD
NEW MACRO). Start on one of the sheets, start your macro recording, click to
the sheet you want to go to (SHEET1), stop the recording. Now go to any
sheet and test your macro. It should take you back to your sheet. Rather
than putting a button on every sheet that calls this macro, you could create
a keyboard shortcut for the macro. This would mean users would not have to
take their hands off the keyboard to click on a button (and you wouldn't have
to create 309 buttons). To create the keyboard shortcut after you have
created the macro, simply choose TOOLS | MACRO | MACROS then click on the
OPTIONS button and choose your shortcut. NOTE: Don't conflict with existing
shortcuts (e.g. CTRL + P, N, O, C, V, etc.) You can use CTRL+SHIFT + letter
if you like.
 
P

Pete_UK

Group all the sheets together by right-clicking on a sheet tab and
clicking Group All Sheets. Then in H1, say, you can enter this
formula:

=HYPERLINK("#Sheet1!A1","First page")

Then ungroup the sheets by right-clicking on a sheet tab and clicking
Ungroup.

This will put a clickable hyperlink in cell H1 on every sheet, showing
"First page" - just click on it to get there.

Hope this helps.

Pete
 
V

vdmbqb

I found out how to create a button and now I have the code to assign-but I
can not figure out how to assign the code.
 
L

Lars-Åke Aspelin

In design mode, right click on the button and choose "Assign macro".

But, as has been pointed out, making 309 buttons might not be the best
solution to your problem. See other suggestions in this thread,

/ Lars-Åke
 
Ad

Advertisements


Top