我想将显示的文本变成一个超链接,当您选择显示的文本时,它会将您带到工作表和单元格。
我做错了什么?
提前谢谢你,
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
答案 0 :(得分:0)
我只是在你的情况下这样做来创建超链接。它灵活且易于操作。
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)