+ Reply to Thread
Results 1 to 10 of 10

Macro to jump to a specific tab.

  1. #1
    Registered User
    Join Date
    05-24-2018
    Location
    Canada
    MS-Off Ver
    Windows 7
    Posts
    35

    Macro to jump to a specific tab.

    Hi,

    I want to a dropdown macro on the first tab to allow users to jump to other tabs.
    Each other tab will be a month of the year.

    Thank you

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Macro to jump to a specific tab.

    You already have that functionality within Excel. Right-click on the sheet navigation icons in the bottom left corner of the file window, and you will see a list of all sheets within the file. Just click on the one you want to go to, and hey presto!

    Hope this helps.

    Pete

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Macro to jump to a specific tab.

    Generally speaking you'd use Worksheet_Change event.

    Assuming that you have data validation dropdown in A2 of first sheet.
    Please Login or Register  to view this content.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Macro to jump to a specific tab.

    https://www.excelforum.com/excel-pro...t=#post4983807

    Have a look at a form that lists the sheets - double clicking navigates to sheet
    Edit: Wrong workbook attached to that post
    Attached Files Attached Files
    Last edited by nigelog; 10-11-2018 at 12:12 PM.

  5. #5
    Registered User
    Join Date
    05-24-2018
    Location
    Canada
    MS-Off Ver
    Windows 7
    Posts
    35

    Re: Macro to jump to a specific tab.

    Hi Pete,

    Thank you but having the functionality of a macro dropdown in the middle of the page will enhance user interface experience.

    Thank you

  6. #6
    Registered User
    Join Date
    05-24-2018
    Location
    Canada
    MS-Off Ver
    Windows 7
    Posts
    35

    Re: Macro to jump to a specific tab.

    Attached is an example of what i want assuming all the choices were shown on the first tab.
    Ideally a dropdown would look better

    example.pdf

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Macro to jump to a specific tab.

    Just use data validation list for dropdown. It's not like you need it to be dynamic (month name doesn't increase from 12...).

  8. #8
    Registered User
    Join Date
    05-24-2018
    Location
    Canada
    MS-Off Ver
    Windows 7
    Posts
    35

    Re: Macro to jump to a specific tab.

    Quote Originally Posted by CK76 View Post
    Just use data validation list for dropdown. It's not like you need it to be dynamic (month name doesn't increase from 12...).
    how do i apply this on the workbook ? ive included it in a module and added a data validation on A2 to try it out but the macro doesnt appear in the macro list ?

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Macro to jump to a specific tab.

    You paste in the macro to Sheet module.

    In your case, go into VBE, double click on your Balance sheet in Project explorer pane, and paste in the code.

    See sample attached. Change dropdown selection in A2 of "Balance" sheet, and it will immediately jump to cell A1 of selected sheet name.
    Attached Files Attached Files

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Macro to jump to a specific tab.

    Here is a (sort of) non-VBA approach, it uses a User Defined Function. This option does not use a DD, but instead, lists all sheet names, which are clickable to take you to the sheet you want.

    1st create a range name (I called mine Sheetnames)
    Then put this in the Refers To box: =REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")

    To get a list of sheet names, put this in a cell and copy down (started in A2)...
    =IFERROR(INDEX(Sheetnames,ROWS($A$2:A2)),"")

    Seeing as how you want to be able to click the cell and go to that worksheet, change that formula to this...
    =IFERROR(HYPERLINK("#"&"'"&INDEX(Sheetnames,ROWS($A$2:A2))&"'!A1",INDEX(Sheetnames,ROWS($A$2:A2))),"")

    Note that this uses a UDF (User Defined Function) and requires that you save the file a .xlsm
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Using Dropdown to jump to specific cell
    By billio75 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2018, 12:28 PM
  2. Hyperlink from powerpoint to jump to specific PDF page??
    By JRC1 in forum PowerPoint Formatting & General
    Replies: 0
    Last Post: 04-28-2017, 05:58 AM
  3. [SOLVED] If answer Yes on a dropdown box, jump to a specific cell?
    By trenzalore888 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2016, 02:50 PM
  4. how to jump into a specific cell
    By excelrio in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 08-07-2016, 10:18 PM
  5. Replies: 2
    Last Post: 04-22-2013, 04:29 PM
  6. Replies: 4
    Last Post: 01-25-2013, 08:40 AM
  7. Need macro to jump to specific cell determined by date.
    By mhelmers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 06:19 PM

Tags for this Thread

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