Loncat ke daftar isi utama

Bagaimana cara mengubah beberapa jalur hyperlink sekaligus di Excel?

Untuk beberapa tujuan, Anda dapat membuat beberapa hyperlink untuk data Anda di lembar kerja, dan semua hyperlink ditautkan ke jalur file atau alamat yang sama, tetapi sekarang, Anda perlu mengganti jalur hyperlink ini dengan alamat lain pada satu waktu. Untuk mengubah jalur hyperlink secara individual dapat membuang banyak waktu, adakah cara cepat untuk mengatasi masalah ini?

Ubah beberapa jalur hyperlink sekaligus di lembar kerja dengan kode VBA

Ubah beberapa jalur hyperlink sekaligus di lembar kerja / buku kerja / beberapa lembar / pilihan dengan fitur luar biasa


Ubah beberapa jalur hyperlink sekaligus di lembar kerja dengan kode VBA

Misalkan Anda memiliki daftar data dengan hyperlink yang sama seperti tangkapan layar berikut yang ditampilkan, dan dengan kode VBA, Anda dapat dengan cepat mengganti jalur atau alamat file lama di lembar kerja dengan yang baru.

1. Tahan ALT + F11 kunci, dan itu membuka Jendela Microsoft Visual Basic untuk Aplikasi.

2. Klik Menyisipkan > Modul, dan tempelkan makro berikut di file Jendela modul.

Kode VBA: ubah beberapa jalur hyperlink sekaligus

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. Lalu tekan F5 kunci untuk menjalankan kode ini, dan kotak prompt untuk membiarkan Anda memasukkan alamat hyperlink lama Anda ke Teks lama kotak. Lihat tangkapan layar:

4. Klik OK, dan kotak prompt lain muncul untuk mengingatkan Anda memasukkan alamat hyperlink baru yang ingin Anda gunakan.

5. Dan kemudian klik OK, semua alamat hyperlink lama yang sama telah diganti dengan yang baru sekaligus. Lihat tangkapan layar:


Ubah beberapa jalur hyperlink sekaligus di lembar kerja / buku kerja / beberapa lembar / pilihan dengan fitur luar biasa

Jika Anda ingin mengganti jalur hyperlink dari pilihan, beberapa lembar, buku kerja saat ini, atau beberapa buku kerja, bagaimana Anda bisa melakukannya? Dengan Cari dan Ganti fitur dari Kutools untuk Excel, Anda dapat dengan cepat menangani tugas ini.

Catatan:Untuk menerapkan ini Cari dan Ganti utilitas, pertama, Anda harus mengunduh file Kutools untuk Excel, lalu terapkan fitur dengan cepat dan mudah.

Setelah menginstal Kutools untuk Excel, lakukan seperti ini:

1. Klik Kutools > Navigasi, lihat tangkapan layar:

2. Di tempat terbuka Navigasi pane, klik Temukan dan ganti tab, di Cari dan Ganti pane, klik menggantikan tab, lalu lakukan operasi berikut:

  • Masukkan teks hyperlink lama yang ingin Anda temukan ke dalam file Temukan apa kotak teks, lalu ketikkan teks hyperlink baru yang ingin Anda ganti ke dalam Ganti dengan kolom tulisan;
  • Tentukan cakupan tempat Anda ingin mencari dan mengganti jalur hyperlink dari Dalam daftar drop-down;
  • Kemudian, pilih Hyperlinks dari Lihat di drop down;
  • Terakhir, klik Temukan semua tombol, semua sel terkait yang berisi teks hyperlink tertentu telah dicantumkan ke dalam kotak daftar bawah.

3. Lalu klik Ganti Semua tombol, jalur hyperlink lama telah diubah ke yang baru sekaligus, lihat tangkapan layar:

Klik untuk Mengunduh Kutools for Excel untuk Uji Coba Gratis!


Artikel yang lebih relatif:

  • Ekstrak Alamat Sebenarnya Dari Hyperlink
  • Misalkan Anda memiliki berbagai sel yang berisi hyperlink, dan sekarang Anda perlu melihat tujuan sebenarnya dari hyperlink dan mengekstraknya dari hyperlink seperti gambar berikut yang ditampilkan. Adakah cara mudah untuk mengatasi masalah ini dengan cepat?
  • Ubah URL Gambar Menjadi Gambar Sebenarnya Di Excel
  • Jika Anda memiliki daftar alamat URL gambar di kolom A, dan sekarang, Anda ingin mendownload gambar yang sesuai dari URL dan menampilkannya ke kolom B yang berdekatan seperti gambar di sebelah kiri yang ditampilkan. Di Excel, bagaimana Anda bisa mengekstrak gambar sebenarnya dari URL gambar dengan cepat dan mudah?
  • Ubah Teks Url Menjadi Hyperlink yang Dapat Diklik Di Excel
  • Misalkan Anda memiliki beberapa url di lembar kerja Anda, tetapi tidak ditautkan, dan sekarang Anda perlu mengonversi semua url yang tidak tertaut menjadi hyperlink yang dapat diklik, seperti yang ditunjukkan tangkapan layar berikut. Tentu saja, Anda dapat mengeklik dua kali satu per satu agar dapat diklik, tetapi ini akan memakan waktu jika ada banyak url. Bagaimana Anda bisa mengonversi beberapa url yang tidak tertaut menjadi hyperlink yang dapat diklik secara otomatis di Excel?
  • Buka Halaman Tertentu Dokumen PDF Dari Hyperlink Excel
  • Saat Anda menautkan sel ke file PDF, biasanya, Anda akan masuk ke halaman pertama file PDF saat Anda mengklik untuk membuka hyperlink. Jika Anda perlu langsung melompat ke halaman tertentu dari file PDF dengan mengklik hyperlink, artikel ini mungkin bisa membantu Anda.

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
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