简体   繁体   English

如何创建链接到下拉列表的打开/转到按钮

[英]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).我有一个 excel 工作簿,里面有多张工作表,其中的工作表名为 (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).以一种简单的方式..如果我从下拉列表中选择数字(1)并点击按钮,它将带我到名为(1)的工作表。

Thanks in advance.提前致谢。

Say the drop-down is in cell B9 .假设下拉菜单位于单元格B9中。 Put some Shape on the worksheet and assign this macro to it:在工作表上放置一些Shape并将此宏分配给它:

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

Note:笔记:

We convert possible numbers into strings我们将可能的数字转换为字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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