メインコンテンツへスキップ

Excelで一度に複数のハイパーリンクパスを変更するにはどうすればよいですか?

目的によっては、ワークシート内のデータに複数のハイパーリンクを作成し、すべてのハイパーリンクを同じファイルパスまたはアドレスにリンクすることができますが、このハイパーリンクパスを一度に別のアドレスに置き換える必要があります。 ハイパーリンクのパスを個別に変更すると、多くの時間が無駄になる可能性がありますが、この問題を解決する簡単な方法はありますか?

VBAコードを使用してワークシートで複数のハイパーリンクパスを一度に変更する

ワークシート/ワークブック/複数のシート/選択で複数のハイパーリンクパスを一度に変更する驚くべき機能


VBAコードを使用してワークシートで複数のハイパーリンクパスを一度に変更する

次のスクリーンショットと同じハイパーリンクを持つデータのリストがあり、VBAコードを使用すると、ワークシート内の古いファイルパスまたはアドレスを新しいものにすばやく置き換えることができます。

1. 押したまま Alt + F11 キー、そしてそれは開きます Microsoft Visual Basic forApplicationsウィンドウ.

2. インセット > モジュール、次のマクロをに貼り付けます モジュールウィンドウ.

VBAコード:一度に複数のハイパーリンクパスを変更する

Sub ReplaceHyperlinks()
'Updateby Extendoffice
Dim Ws As Worksheet
Dim xHyperlink As Hyperlink
Dim xOld As String, xNew As String
xTitleId = "KutoolsforExcel"
Set Ws = Application.ActiveSheet
xOld = Application.InputBox("Old text:", xTitleId, "", Type:=2)
xNew = Application.InputBox("New text:", xTitleId, "", Type:=2)
Application.ScreenUpdating = False
For Each xHyperlink In Ws.Hyperlinks
    xHyperlink.Address = Replace(xHyperlink.Address, xOld, xNew)
Next
Application.ScreenUpdating = True
End Sub

3。 次に、 F5 このコードを実行するためのキーと、古いハイパーリンクアドレスをに入力するためのプロンプトボックス 古いテキスト ボックス。 スクリーンショットを参照してください:

4に設定します。 OK をクリックします。 OK、および別のプロンプトボックスが表示され、使用する新しいハイパーリンクアドレスを入力するように通知されます。

5。 そして、 OK、すべて同じ古いハイパーリンクアドレスが一度に新しいアドレスに置き換えられました。 スクリーンショットを参照してください:


ワークシート/ワークブック/複数のシート/選択で複数のハイパーリンクパスを一度に変更する驚くべき機能

選択範囲、複数のシート、現在のワーククック、または複数のワークブックからのハイパーリンクパスを置き換える場合は、どうすればよいですか? と 検索および置換 の特徴 Kutools for Excel、このタスクにすばやく対処できます。

注:これを適用する 検索および置換 ユーティリティ、まず、ダウンロードする必要があります Kutools for Excel、次に機能をすばやく簡単に適用します。

インストールした後 Kutools for Excel、次のようにしてください。

1に設定します。 OK をクリックします。 クツール > ナビゲーション、スクリーンショットを参照してください:

2。 オープンで ナビゲーション ペインをクリック 検索と置換 タブの 検索および置換 ペインをクリック 交換する タブをクリックし、次の操作を実行します。

  • 検索する古いハイパーリンクテキストをに入力します 見つける テキストボックスに移動し、置換する新しいハイパーリンクテキストを と交換 テキストボックス;
  • ハイパーリンクパスを検索して置き換えるスコープを指定し、 中で ドロップダウンリスト;
  • 次に、[探す場所]ドロップダウンから[ハイパーリンク]を選択します。
  • 最後に、 すべて検索 ボタンをクリックすると、特定のハイパーリンクテキストを含むすべての対応するセルが下部のリストボックスに一覧表示されます。

3。 次に、をクリックします。 すべて置換 ボタンをクリックすると、古いハイパーリンクパスが一度に新しいパスに変更されます。スクリーンショットを参照してください。

クリックしてExcel用のKutoolsを無料トライアルでダウンロードしてください!


より相対的な記事:

  • ハイパーリンクから実際のアドレスを抽出する
  • ハイパーリンクを含むセルの範囲があり、次に示すスクリーンショットのように、ハイパーリンクの実際の宛先を確認し、ハイパーリンクからそれらを抽出する必要があるとします。 この問題をすばやく解決する簡単な方法はありますか?
  • Excelで画像のURLを実際の画像に変換する
  • 列Aに画像のURLアドレスのリストがあり、ここで、対応する画像をURLからダウンロードして、左のスクリーンショットに示すように隣接する列Bに表示します。 Excelで、画像のURLから実際の画像をすばやく簡単に抽出するにはどうすればよいでしょうか。
  • ExcelでURLテキストをクリック可能なハイパーリンクに変換する
  • ワークシートに複数のURLがあり、それらがリンクされていない場合、次のスクリーンショットに示すように、リンクされていないすべてのURLをクリック可能なハイパーリンクに変換する必要があります。 もちろん、XNUMXつずつダブルクリックしてクリック可能にすることもできますが、URLが多い場合は時間がかかります。 リンクされていない複数のURLをExcelで自動的にクリック可能なハイパーリンクに変換するにはどうすればよいですか?
  • ExcelハイパーリンクからPDFドキュメントの特定のページを開く
  • セルをPDFファイルにリンクすると、通常、クリックしてハイパーリンクを開くと、PDFファイルの最初のページに移動します。 ハイパーリンクをクリックしてPDFファイルの特定のページに直接ジャンプする必要がある場合は、この記事を参考にしてください。

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (47)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
This might be an older article, but was exactly what I needed. Thank you!
This comment was minimized by the moderator on the site
hi
thanks man you helped me a lot
This comment was minimized by the moderator on the site
I downloaded this and gave it a try and it did nothing. My hyperlinks look like this: file///\\server\shared\PO\CY2021\25079.pdf. I'm trying to change "server" to "server1" after a migration. I do the find/replace and choose Hyperlink, execute it, and... nothing happens. 
Any ideas?
This comment was minimized by the moderator on the site
Hello John,Sorry to hear that. The reason why the find/replace function didn't work is that your hyperlink file///\\server\shared\PO\CY2021\25079.pdf is not valid. According to the Excel dialog box, it shows the address of this site is not valid. Check the address and try again.
Then when I change your hyperlink to http://file///\\server\shared\PO\CY2021\25079.pdf, the find/replace function works perfectly. Please have a try. Have a nice day.
Sincerely,Mandy
This comment was minimized by the moderator on the site
Muchas gracias, me ahorraste mucho tiempo actualizando hipervinculos!
This comment was minimized by the moderator on the site
Muito obrigado! Você me salvou dezenas de horas de sono que seriam perdidas atualizando links.
This comment was minimized by the moderator on the site
Would it be possible to have a version to set a macro in power point for update links to excel, happens that monthly we need to link the power point presentation to a new excel in a new location. I have to do it one by one and it takes hours! MANY THANKS!!!!

This comment was minimized by the moderator on the site
Thankyou so much for the vba fix. I knew there had to be an easy way to fix my hyperlink problem and you provided it :) I am extremely grateful.
This comment was minimized by the moderator on the site
Many thanks for the VBA code to change multiple hyperlink paths at once. Would it be possible to have a version that would go through the different tabs (worksheets) of the xls workbook, as the current version only seems to change the links in the active worksheet? Would be highly appreciated!

Thanks,

Schweppy
This comment was minimized by the moderator on the site
Hello, Schweppy,
The below code can help you to replace the hyperlinks in all sheets, please try.

Sub ReplaceHyperlinks()
Dim xWs As Worksheet
Dim xWss As Sheets
Dim xHyperlink As Hyperlink
Dim xOld As String, xNew As String
xTitleId = "KutoolsforExcel"
Set WS = Application.ActiveSheet
xOld = Application.InputBox("Old text:", xTitleId, "", Type:=2)
xNew = Application.InputBox("New text:", xTitleId, "", Type:=2)
Application.ScreenUpdating = False
Set xWss = Application.ActiveWorkbook.Worksheets
For Each xWs In xWss
For Each xHyperlink In xWs.Hyperlinks
xHyperlink.Address = Replace(xHyperlink.Address, xOld, xNew)
Next
Next xWs
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
This is amazing!!! Thank you for posting the code that works for all of the worksheets. I had the hardest time finding this and couldn't figure out how to create it myself. Thank you so much for sharing your code with the world!!!
Rated 5 out of 5
This comment was minimized by the moderator on the site
Your code helped me update hundreds of hyperlinks in a blink of an eye. Thank you soo much for you help.
This comment was minimized by the moderator on the site
Thanks a lot, works perfectly fine. Highly appreciated.
This comment was minimized by the moderator on the site
Glad it helps. Any questions, please feel free to contact us. Have a nice day!
This comment was minimized by the moderator on the site
Many thanks for the VBA code to change multiple hyperlink paths at once. Would it be possible to have a version that would go through the different tabs (worksheets) of the xls workbook, as the current version only seems to change the links in the active worksheet? Would be highly appreciated!

Thanks,

Schweppy
This comment was minimized by the moderator on the site
Had a spreadsheet with over 200 items that had hyperlinks that needed to be edited. This just saved me SO MUCH TIME. THANK YOU!!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations