+ Reply to Thread
Results 1 to 3 of 3

Creating buttons to select different work sheets

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel Pro Plus 2010
    Posts
    3

    Creating buttons to select different work sheets

    Hi everyone,

    This is my first post in here and I have found most of the answers to my problems so far, so thank you!

    The problem I have but cant find the answer to is:

    I would like to have my workbook open onto a work sheet that has a series of buttons that the user can choose to see a particular sheet, but I dont know where to begin. I would be very grateful for any answers to help me with this project.

    Thank you

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating buttons to select different work sheets

    Hi,

    Use the Workbook Open event and add

    Sheet1.Activate
    where Sheet1 is the VBA code name of the sheet containing your buttons. This will force the buttons sheet to be the active sheet when the workbook is opened.


    If you use an Activex button, i.e. Developer, Insert (in the Controls area of the ribbon), add an activex button
    You can then right click on the button and in the 'View Code' Button Click procedure which opens add a line of code

    Sheet2.Activate

    In this case Sheet2 is the VBA sheet code name and it may be the same as the sheet tab name. However since people can change tab names it's best to use the VBA code name all the time.

    You could use
    Sheets("Sheet2").Activate
    syntax but if the sheet name is changed then the macro won't work.

    You could instead use any other shape or picture object and in the Visual Basic area at the Module level add a new procedure - say

    Please Login or Register  to view this content.
    and in the right click event of the button shape/picture object pick 'Assign macro' and select the 'MyButton1' macro
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Creating buttons to select different work sheets

    see attached

    uses active x command buttons
    http://office.microsoft.com/en-gb/ex...010342137.aspx
    also a workbook open macro to open on sheet 1
    right click tab,view code,look at this workbook
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Select several work sheets in the same book with PP in tab name ...
    By james 35 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2013, 08:12 AM
  2. Creating a macro to print only the sheets and portion of sheets that i select.
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2012, 01:48 PM
  3. [SOLVED] creating consecutive dated (weekly) work sheets within a workbook
    By bite_tony in forum Excel General
    Replies: 4
    Last Post: 04-18-2012, 07:09 AM
  4. Programable buttons in work sheets for excel 2007?
    By dariuscurrie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2008, 04:42 AM
  5. Creating New work sheets and assigning names automatically
    By paz24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2006, 08:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1