ไปยังเนื้อหาหลัก

วิธีเปลี่ยนเส้นทางการเชื่อมโยงหลายมิติพร้อมกันใน Excel

เพื่อจุดประสงค์บางอย่างคุณอาจสร้างไฮเปอร์ลิงก์หลายรายการสำหรับข้อมูลของคุณในแผ่นงานและไฮเปอร์ลิงก์ทั้งหมดจะเชื่อมโยงกับเส้นทางไฟล์หรือที่อยู่เดียวกัน แต่ตอนนี้คุณต้องแทนที่เส้นทางไฮเปอร์ลิงก์นี้ด้วยที่อยู่อื่นในแต่ละครั้ง หากต้องการเปลี่ยนเส้นทางของการเชื่อมโยงหลายมิติทีละรายการอาจเสียเวลามากมีวิธีที่รวดเร็วในการแก้ปัญหานี้หรือไม่?

เปลี่ยนเส้นทางการเชื่อมโยงหลายมิติพร้อมกันในแผ่นงานด้วยรหัส VBA

เปลี่ยนเส้นทางการเชื่อมโยงหลายมิติพร้อมกันในแผ่นงาน / สมุดงาน / แผ่นงานหลายแผ่น / การเลือกด้วยคุณสมบัติที่น่าทึ่ง


เปลี่ยนเส้นทางการเชื่อมโยงหลายมิติพร้อมกันในแผ่นงานด้วยรหัส VBA

สมมติว่าคุณมีรายการข้อมูลที่มีไฮเปอร์ลิงก์เดียวกันกับภาพหน้าจอต่อไปนี้และด้วยรหัส VBA คุณสามารถแทนที่เส้นทางไฟล์เก่าหรือที่อยู่ในแผ่นงานด้วยรายการใหม่

1. ค้างไว้ ALT + F11 และจะเปิดไฟล์ หน้าต่าง Microsoft Visual Basic สำหรับแอปพลิเคชัน.

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และกล่องพรอมต์อื่นจะปรากฏขึ้นเพื่อเตือนให้คุณป้อนที่อยู่ไฮเปอร์ลิงก์ใหม่ที่คุณต้องการใช้

5. จากนั้นคลิก OKที่อยู่ไฮเปอร์ลิงก์เดิมทั้งหมดจะถูกแทนที่ด้วยที่อยู่ใหม่พร้อมกัน ดูภาพหน้าจอ:


เปลี่ยนเส้นทางการเชื่อมโยงหลายมิติพร้อมกันในแผ่นงาน / สมุดงาน / แผ่นงานหลายแผ่น / การเลือกด้วยคุณสมบัติที่น่าทึ่ง

หากคุณต้องการแทนที่เส้นทางไฮเปอร์ลิงก์จากส่วนที่เลือกหลายแผ่นงานสมุดงานปัจจุบันหรือสมุดงานหลายเล่มคุณจะทำอย่างไร ด้วย ค้นหาและแทนที่ คุณลักษณะของ Kutools สำหรับ Excelคุณสามารถจัดการกับงานนี้ได้อย่างรวดเร็ว

หมายเหตุที่จะใช้สิ่งนี้ ค้นหาและแทนที่ ยูทิลิตี้ประการแรกคุณควรดาวน์โหลดไฟล์ Kutools สำหรับ Excelแล้วใช้คุณสมบัตินี้อย่างรวดเร็วและง่ายดาย

หลังจากการติดตั้ง Kutools สำหรับ Excelโปรดทำตามนี้:

1. คลิก Kutools > การเดินเรือดูภาพหน้าจอ:

2. ในการเปิด การเดินเรือ บานหน้าต่างคลิก ค้นหาและแทนที่ ในแท็บ ค้นหาและแทนที่ บานหน้าต่างคลิก แทนที่ จากนั้นดำเนินการดังต่อไปนี้:

  • ป้อนข้อความไฮเปอร์ลิงก์เก่าที่คุณต้องการค้นหาลงในไฟล์ สิ่งที่ค้นหา กล่องข้อความแล้วพิมพ์ข้อความไฮเปอร์ลิงก์ใหม่ที่คุณต้องการแทนที่ลงในไฟล์ แทนที่ด้วย กล่องข้อความ;
  • ระบุขอบเขตที่คุณต้องการค้นหาและแทนที่เส้นทางการเชื่อมโยงหลายมิติจากไฟล์ ภายใน รายการแบบหล่นลง
  • จากนั้นเลือกไฮเปอร์ลิงก์จากเมนูแบบเลื่อนลงมองหา
  • ในที่สุดคลิก ค้นหาทั้งหมด เซลล์ที่เกี่ยวข้องทั้งหมดที่มีข้อความไฮเปอร์ลิงก์ที่ระบุถูกแสดงไว้ในกล่องรายการด้านล่าง

3. จากนั้นคลิก แทนที่ทั้งหมด ปุ่มเส้นทางการเชื่อมโยงหลายมิติเก่าถูกเปลี่ยนเป็นเส้นทางใหม่พร้อมกันดูภาพหน้าจอ:

คลิกเพื่อดาวน์โหลด Kutools for Excel เพื่อทดลองใช้ฟรี!


บทความที่เกี่ยวข้องเพิ่มเติม:

  • แยกที่อยู่จริงจากไฮเปอร์ลิงก์
  • สมมติว่าคุณมีช่วงของเซลล์ที่มีการเชื่อมโยงหลายมิติและตอนนี้คุณต้องเห็นปลายทางที่แท้จริงของไฮเปอร์ลิงก์และแยกออกจากไฮเปอร์ลิงก์ตามภาพหน้าจอต่อไปนี้ มีวิธีง่ายๆในการแก้ปัญหานี้อย่างรวดเร็วหรือไม่?
  • แปลง URL ของรูปภาพเป็นรูปภาพจริงใน Excel
  • หากคุณมีรายการที่อยู่ URL รูปภาพในคอลัมน์ A และตอนนี้คุณต้องการดาวน์โหลดรูปภาพที่เกี่ยวข้องจาก URL และแสดงลงในคอลัมน์ B ที่อยู่ติดกันตามภาพหน้าจอด้านซ้ายที่แสดง ใน Excel คุณจะดึงรูปภาพจริงจาก URL ของรูปภาพอย่างรวดเร็วและง่ายดายได้อย่างไร
  • แปลงข้อความ URL เป็นไฮเปอร์ลิงก์ที่คลิกได้ใน Excel
  • สมมติว่าคุณมีหลาย URL ในแผ่นงานของคุณ แต่ไม่ได้เชื่อมโยงกันและตอนนี้คุณต้องแปลง URL ที่ไม่ได้เชื่อมโยงทั้งหมดให้เป็นไฮเปอร์ลิงก์ที่คลิกได้ดังภาพหน้าจอต่อไปนี้ แน่นอนคุณสามารถดับเบิลคลิกทีละรายการเพื่อให้คลิกได้ แต่จะใช้เวลานานหากมี URL จำนวนมาก คุณจะแปลง URL ที่ไม่ได้เชื่อมโยงหลายรายการเป็นไฮเปอร์ลิงก์ที่คลิกได้โดยอัตโนมัติใน Excel ได้อย่างไร
  • เปิดหน้าเฉพาะของเอกสาร PDF จากไฮเปอร์ลิงก์ของ Excel
  • เมื่อคุณเชื่อมโยงเซลล์กับไฟล์ PDF โดยปกติคุณจะไปที่หน้าแรกของไฟล์ PDF เมื่อคุณคลิกเพื่อเปิดไฮเปอร์ลิงก์ หากคุณต้องการข้ามไปยังหน้าใดหน้าหนึ่งของไฟล์ PDF โดยตรงโดยคลิกที่ไฮเปอร์ลิงก์บทความนี้อาจช่วยคุณได้

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, 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