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

 จะสร้างไฮเปอร์ลิงก์ที่คลิกได้ในตาราง Pivot ได้อย่างไร?

คุณสามารถคลิกไฮเปอร์ลิงก์เพื่อเชื่อมโยงไปยังหน้าเว็บในเวิร์กชีตได้อย่างง่ายดาย แต่ถ้าคุณสร้างตาราง Pivot ซึ่งมีไฮเปอร์ลิงก์ไฮเปอร์ลิงก์จะไม่สามารถคลิกได้ คุณมีแนวคิดดีๆในการแก้ปัญหานี้ใน Excel หรือไม่?

สร้างไฮเปอร์ลิงก์ที่คลิกได้ในตาราง Pivot ด้วยรหัส VBA


ลูกศรสีฟ้าฟองขวา สร้างไฮเปอร์ลิงก์ที่คลิกได้ในตาราง Pivot ด้วยรหัส VBA

ไฮเปอร์ลิงก์ไม่ทำงานในตาราง Pivot ตามค่าเริ่มต้น แต่โชคดีที่คุณสามารถสร้างรหัส VBA เพื่อให้ไฮเปอร์ลิงก์สามารถคลิกได้ในตาราง Pivot

1. กด ALT + F11 และจะเปิดไฟล์ หน้าต่าง Microsoft Visual Basic for Applications.

2. จากนั้นเลือกแผ่นงานที่คุณใช้จากด้านซ้าย นักสำรวจโครงการ บานหน้าต่างให้ดับเบิลคลิกเพื่อเปิดไฟล์ โมดูลจากนั้นคัดลอกและวางโค้ด VBA ต่อไปนี้ลงในช่องว่าง โมดูล:

รหัส VBA: สร้างไฮเปอร์ลิงก์ที่คลิกได้ในตาราง Pivot

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update 20140814
If Target.Cells.Count <> 1 Then Exit Sub
On Error Resume Next
Application.ActiveWorkbook.FollowHyperlink Address:=CStr(Target.Value), NewWindow:=True
End Sub

doc-make-ไฮเปอร์ลิงก์-คลิก-pivottable-1

3. จากนั้นบันทึกและปิดรหัสนี้กลับไปที่แผ่นงานของคุณและตอนนี้เมื่อคุณคลิกไฮเปอร์ลิงก์ในตาราง Pivot ของคุณไฮเปอร์ลิงก์จะเปิดใช้งานและลิงก์ไปยังหน้าเว็บ

หมายเหตุ: รหัสนี้ใช้ได้เฉพาะกับลิงก์ของหน้าเว็บที่ขึ้นต้นด้วย Http: //

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

🤖 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 (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Anyone know how to run this on only one column in the pivot table...as all my columns are clickable, even though there is no link behind them......
This comment was minimized by the moderator on the site
Muchas gracias. A mi me ha funcionado con enlaces a peliculas de mi disco duro, que tenia una base de datos de mis pelis. Asi que no solo funciona con http... o al menos a mi me ha servido.
This comment was minimized by the moderator on the site
I tried the oce but it doesn't work. I someone willing to take a look at my document ?
This comment was minimized by the moderator on the site
I have two types of data in my pivot table that would use a hyperlink: 1. a hyperlink to a document located on a shared drive. 2. an email address that I would like to use the mailto link to open an email. The macro above works for the document, but I can't figure out how to make it work for the email. Any ideas?
This comment was minimized by the moderator on the site
This works very well, but I'm trying to figure out how to have a shorter friendly name to click on rather than a long URL. I have 3 columns of different links and they all run together visually. A symbol or even a friendly name based on a previous cell in that row would be excellent.
This comment was minimized by the moderator on the site
What about Hyperlinking documents within the pivot table?
This comment was minimized by the moderator on the site
This will make it so it works across all workbooks. Enter this into "ThisWorkbook" rather than individual sheets. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) ' MsgBox Sh.Name ' MsgBox Target.Address If Target.Cells.Count = 1 Then On Error Resume Next ActiveWorkbook.FollowHyperlink Address:=CStr(Target.Value), NewWindow:=True On Error GoTo 0 End If End Sub
This comment was minimized by the moderator on the site
Why is the hyperlink not working? Please help!! https://www.dropbox.com/s/zyp8e2g0sqygweb/zero%20test%202.xlsm?dl=0
I have tried in a number of ways, tab and worksheet specific - and to no avail..
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations