实际工作簿中工作表的超链接
如何将超链接添加到特定单元格并将其寻址到 Excel 文件中的工作表?
这就是我已经得到的:
Cells(zeile, 1).Select
Worksheets(1).Hyperlinks.Add Anchor:=Selection, Address:=Workbooks(1).Worksheets(fortnr), SubAddress:=Cells(1, 1).Address
谢谢。
How can i add a Hyperlink to a specific cell and address it to a Worksheet in the Excel file?
This is what I already got:
Cells(zeile, 1).Select
Worksheets(1).Hyperlinks.Add Anchor:=Selection, Address:=Workbooks(1).Worksheets(fortnr), SubAddress:=Cells(1, 1).Address
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
地址应为空,子地址应采用 Sheet1!A1 的形式。这会在活动单元格中放置一个链接,假设您有一个名为 fortnr 的变量,该变量在同一工作簿中包含有效的工作表名称。
如果您想指向不同工作簿中的单元格,则一切都相同,只是地址必须是该文件。
假设 Workbooks(1) 是一个不同的文件,并且之前已保存并具有正确名称的工作表等。
The Address should be blank and the SubAddress should be in the form Sheet1!A1. This puts a link in the activecell assuming you have a variable named fortnr that contains a valid sheet name in the same workbook.
If you want to point to a cell in a different workbook, then everything is the same except the Address needs to be that file.
Assuming Workbooks(1) is a different file and has been previously saved and has a sheet with the right name, etc, etc.
想法 1:向当前活动单元格添加超链接
假设要链接的工作表名称是“VBA1”
想法 2:向名为“CallButton”的形状添加超链接
Idea 1: Add a hyperlink to current active cell
Assume the sheet name to link to is "VBA1"
Idea 2: Add a hyperlink to a shape that is named as "CallButton"
如果您尝试通过 UI 执行此操作:
转到插入、超链接
选择本文档中的位置
选择工作表以及要添加的单元格。
这些链接将添加到您的电子表格中。
If you are trying to do this via UI:
Go to Insert, Hyperlink
Select Place in This Document
Select the worksheets and the cells you want to add.
The links will be added in your spreasheet.