【发布时间】:2019-01-16 19:22:05
【问题描述】:
我正在尝试搜索已创建的名称为 TextBox1.Value 的工作表。然后在名为“员工列表”的工作表上找到同名,并将该单元格超链接到同名工作表。
它试图链接到我正在工作的文件夹中的“名称”。它甚至没有到达工作簿内部。我在.Hyperlinks 中缺少参数吗?
Dim findEmployee As Range
Dim foundEmployee As Range
Set findEmployee = Sheets("Employee List").Range("A:A")
Set foundEmployee = findEmployee.Find(TextBox1.Value)
With Worksheets("Employee List")
.Hyperlinks.Add
Anchor:=.Range(foundEmployee.Address), _ Address:=Worksheets(TextBox1.Value).Range("A1"), _
TextToDisplay:=TextBox1.Value
End With
【问题讨论】:
标签: excel vba hyperlink range worksheet