excel - Creating hyperlinks to other sheets with VBA using name reference -
one of sheets list of several (not all) other sheets in workbook. depending on several parameters, list not contain same sheets.
i want creation of hyperlink. name of sheet want link (ws.name) being called in. hyperlink has use this, not hard coded name. far i've had this:
activesheet.hyperlinks.add _ anchor:=f_listemoms.range("col_mom")(j), _ address:="'" & ws.name & "'!a1", _ texttodisplay:=nommom in anchor functioning great, no need worry anchor. said destination cannot reached when clicked, , right clicking hyperlink > modify hyperlink shows address this: ['mom11'!a1 ]. ws.name string "mom11".
i've had version didn't work either because i'm not sure how put it:
f_listemoms.range("col_mom")(j).formular1c1 = "=hyperlink(" & ws.name & ",""click here"")" does know i'm doing wrong, or can show alternative method? thanks!
try format (using subaddress):
sheet1.hyperlinks.add _ anchor:=sheet1.range("c3"), _ address:="", _ subaddress:="'" & sheet2.name & "'!a1", _ texttodisplay:="sheet 2" .
note: subaddress targets location in current file (internal excel navigation within document), address targets web page - attempts open target in browser
Comments
Post a Comment