excel hyperlink to nothing

前端 未结 4 1317
旧巷少年郎
旧巷少年郎 2020-11-27 23:25

I\'ve got a lot of hyperlinks and I want to assign a macros to each of them and Worksheet_FollowHyperlink captures only Inserted Hyperlinks but not the HYPERLINK() function.

4条回答
  •  一个人的身影
    2020-11-27 23:57

    Select a group of cells and run:

    Sub HyperAdder()
       For Each r In Selection
          ActiveSheet.Hyperlinks.Add Anchor:=r, Address:="", SubAddress:=r.Parent.Name & "!" & r.Address(0, 0), TextToDisplay:="myself"
       Next r
    End Sub
    

提交回复
热议问题