繁体   English   中英

如何在另一个工作表中包含指向单元格的超链接?

[英]How can I include a hyperlink to a cell in another sheet?

我想使显示的文本成为一个超链接,当选择显示的文本时,它将带您到工作表和单元格。

我做错了什么?

先感谢您,

If wb.sheets("Coversheet").Cells(lastRowC, 8) <> WS.Cells(i, 5) Then
    wb.sheets("Coversheet").Cells(lastRowC + 1, 2) = "Carrier"
    wb.sheets("Coversheet").Cells(lastRowC + 1, 3) = "Employee with a $0 salary found. Unable to calculate salary based benefits. Please rerun Census report"
    wb.sheets("Coversheet").Cells(lastRowC + 1, 4) = WS.Cells(i, 4).Hyperlinks(1).Address
End If

在您的情况下,我会简单地创建超链接。 它灵活且易于操作。

Dim hyperlinkLocation As String
hyperlinkLocation = "[ActiveWorkBook.Name"&".xls]1!A1" '<- 1 is the sheet index (important in your case)   


 ActiveWorkSheet.Hyperlinks.Add Anchor:=.(where the link is), Address:=hyperlinkLockation, _ 
        TextToDisplay:=(name of the link)

暂无
暂无

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

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