Creating buttons in Excel 2000

  [DELETED] 17:03 27 Sep 2003

I want to create a button in my worksheet so when clicked it goes to another worksheet within the workbook. As i have about 5-6 worksheets and i dont want to have to click on the tabs at the bottom of the screen, each time i want to change the worksheet. I am finding it difficult to write the Visual Basic Code for it can anyone help me please.


  [DELETED] 17:22 27 Sep 2003

Sub Move()


End Sub

or similar.

An easier way, however, is to right click the arrow buttons on the bottom left (near the sheet tabs) and a pop-up menu will appear.

  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?



  [DELETED] 12:21 28 Sep 2003

Thanks alot Simsy thats has really helped me. You have been a Life Saver Cheers Mate


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

Elsewhere on IDG sites

Microsoft Surface Book 2 15in review

Iglooghost's hyper new music video gives a mutant take on Monument Valley

The best Amazon Prime Day Apple deals 2018

Comment ajouter de la musique à une présentation Google Slides ?