mir ist gerade eine super Idee gekommen.
Ich kopiere Zelle von einem Sheet in einen anderen und will beim Kopiervorgang einen HyperLink auf den ursprünglichen Datensatz setzen.
Leider klappt das mit der Syntax nicht so genau.
Sub WriteRecords(ByVal rngContract As Range, blnRecords As Boolean)
wsContracts.Range(wsContracts.Cells(rngContract.Row, 2), wsContracts.Cells(rngContract. _
Row, 2)).Copy _
wsShipments.Range(wsShipments.Cells(intRowShipments, 2), wsShipments.Cells( _
intRowShipments, 2
wsShipments.Range(wsShipments.Cells(intRowShipments, 2), wsShipments.Cells(intRowShipments, _
2)).Hyperlinks.Add _
Anchor:=wsShipments.Range(wsShipments.Cells(intRowShipments, 2), wsShipments.Cells( _
intRowShipments, 2)), _
Address:="", _
SubAddress:=wsContracts.Range(wsContracts.Cells(rngContract.Row, 2), wsContracts.Cells( _
rngContract.Row, 2)), _
TextToDisplay:="Back to Shipments"
End Sub
So klappt es nicht, weil die Syntax eines HyperLinks müsste so aussehen, ich denke esliegt an der SubAddress. Wie kann ich mit den bestehenden Informationen mir einen HyperLink basteln?
Sub hyperlink
Range("H10").Hyperlinks.Add _
Anchor:=Range("H10"), _
Address:="", _
SubAddress:="Shipments!A3", _
TextToDisplay:="Back to Shipments"
End Sub