I'm not clear...

  Simsy 17:39 27 Sep 2003

about which sheet is is you want to go to each time?

The easiest way to learn the code, I've found, is to record a macro, and look at the code it creates.

In this instance;

1)Draw your button on the sheet

2)Exit "design mode" on thge VBA toolbar

3)Record a new macro, (via Tools>Macros>RecordNewMacro) When the dialog box appears asking for a macro name, just take the default,"Macro1", don't do anything else, and click OK.

4)You should now have a small toolbar on screen with a square, blue button. This is the "Stop recording" button. Select another sheet, using the tabs at the bottom, then hit the "stop recording button.

5)Look at the macro you have just recorded by clicking Tools>Macro>Macros selct macro1 in the box and click "edit" This will open the VisBasic editor and you can see the code. Copy this code, missing out the lines "Sub Macro1" and "End Sub". (Anything in green is "comment" and doesn't cause anything to happen)

6)Click the tab for the sheet with the button on.

7)Click the button on the visbasic toolbar to go into "design mode"

8)Right click the button and choose "view code"

9)Paste the code you previously copied into the vb editor, between the lines "private sub" and "end sub"

10)Back to the spreadsheet, out of design mode and pressing the button will select the chosen sheet as per the macro you recorded.

Apologies if that's oversimplified. Does that help?



This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Apple unveils first ‘pro’ iPhone 11 Pro and 11 Pro Max

IBC 2019: new video tools from Adobe, Blackmagic, Lenovo and more

iOS 13 release date, time & new features

Les meilleurs appareils connectés compatibles avec Google Home (2019)