{"id":438,"date":"2018-09-15T14:30:25","date_gmt":"2018-09-15T19:30:25","guid":{"rendered":"http:\/\/www.offtherichterdesign.com\/Blog\/?p=438"},"modified":"2018-12-12T15:43:52","modified_gmt":"2018-12-12T21:43:52","slug":"run-macro-in-microsoft-excel-to-update-multiple-hyperlinks-at-once","status":"publish","type":"post","link":"https:\/\/offtherichterdesign.com\/Blog\/run-macro-in-microsoft-excel-to-update-multiple-hyperlinks-at-once\/","title":{"rendered":"Run Macro in Microsoft Excel to Update Multiple Hyperlinks at Once"},"content":{"rendered":"<p>Suppose you have a list of data with the same hyperlinks. With VBA code, you can quickly replace the old file path or address with a new one. Here&#8217;s how to do so: <\/p>\n<p>1. Press the ALT + F11 keys, to open the Microsoft Visual Basic for Applications Window.<\/p>\n<p>2. Click Insert &gt; Module, and paste the following macro in the Module window.<\/p>\n<p>3. Paste the following script.<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nSub FixHyperlinks()\r\n    Dim wks As Worksheet\r\n    Dim hl As Hyperlink\r\n    Dim sOld As String\r\n    Dim sNew As String\r\n\r\n    Set wks = ActiveSheet\r\n    sOld = &quot;URL&quot;\r\n    sNew = &quot;NEW URL&quot;\r\n    For Each hl In wks.Hyperlinks\r\n        hl.Address = Replace(hl.Address, sOld, sNew)\r\n    Next hl\r\nEnd Sub\r\n\r\n<\/pre>\n<p><strong>Note: be sure to add your own URLs for sOld and SNew.<\/strong><\/p>\n<p>4. Press F5 to run the macro.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Suppose you have a list of data with the same hyperlinks. With VBA code, you can quickly replace the old file path or address with a new one. Here&#8217;s how to do so: 1. Press the ALT + F11 keys, to open the Microsoft Visual Basic for Applications Window. 2. Click Insert &gt; Module, and&#8230;<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/offtherichterdesign.com\/Blog\/run-macro-in-microsoft-excel-to-update-multiple-hyperlinks-at-once\/\" class=\"themebutton3\">Read More<\/a><\/p>\n<p><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,107],"tags":[5,90,89,91,92],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-coding-with-coffee","category-visual-basic","tag-excel","tag-macro","tag-microsoft","tag-quicktip","tag-visual-basic"],"_links":{"self":[{"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":1,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/posts\/438\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/offtherichterdesign.com\/Blog\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}