简体   繁体   中英

how to create a open/goto button linked to drop-down list

I have an excel workbook with multi sheets inside where the sheets named like (1,2,3,..10). In the dashboard sheet, I created a drop-down list (involve the names of the sheets) with a button. how can I link the button to open a specific sheet based on what I chose from the drop-down list?

in a simple way.. if I chose number(1) from the drop-down list and hit the button, it will take me to the sheet named (1).

Thanks in advance.

Say the drop-down is in cell B9 . Put some Shape on the worksheet and assign this macro to it:

Sub Leap()
    Dim s As String
    s = CStr(Range("B9"))
    Sheets(s).Activate
End Sub

Note:

We convert possible numbers into strings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM