Editing Hyperlinks Excel 2010 Macro

喜欢而已 提交于 2019-12-07 19:58:28

问题


Ok so I want to create a macro to replace a part of a hyperlink. I have tons of hyperlinks in the excel file. Is there a way to create a macro to do this.


For example

  • www.OldName.com/

  • www.Oldname.com/a/

  • www.Oldname.com/b/


to

  • www.NewName.com/

  • www.NewName.com/a/

  • www.Newname.com/b/


回答1:


This will replace your hyperlink, just change the addresses and strings:

Range("E1").Hyperlinks.Add Range("E1"),Replace(Range("E1").Hyperlinks(1).Address,
                              "google", "msn"), , , "newtext"


来源:https://stackoverflow.com/questions/6903884/editing-hyperlinks-excel-2010-macro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!