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

วิธีเพิ่มปลายเมาส์ให้เป็นรูปร่างบางอย่างใน Excel

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

เพิ่มเมาส์เหนือปลายให้เป็นรูปร่างบางอย่างโดยเพิ่มไฮเปอร์ลิงก์
เพิ่มเมาส์เหนือปลายเป็นรูปร่างบางอย่างด้วยรหัส VBA


เพิ่มเมาส์เหนือปลายให้เป็นรูปร่างบางอย่างโดยเพิ่มไฮเปอร์ลิงก์

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

1. คลิกขวาที่รูปร่างที่คุณต้องการเพิ่มเมาส์เหนือปลายแล้วคลิก เชื่อมโยงหลายมิติ จากเมนูคลิกขวา ดูภาพหน้าจอ:

2 ใน แทรกไฮเปอร์ลิงก์ ใหคลิกปุ the ม คำแนะนำบนหน้าจอ ปุ่ม. และใน ตั้งค่า Hyperlink ScreenTip กล่องโต้ตอบป้อนข้อความเคล็ดลับหน้าจอที่คุณต้องการแสดงในขณะที่วางเมาส์เหนือรูปร่าง สุดท้ายคลิกไฟล์ OK ปุ่ม. ดูภาพหน้าจอ:

3. เมื่อมันกลับไปที่ แทรกไฮเปอร์ลิงก์ ใหคลิกปุ the ม ที่คั่นหนังสือ ปุ่ม. จากนั้นป้อน A1 ลงในช่อง Type ในเซลล์อ้างอิงของไฟล์ เลือกวางในเอกสาร แล้วคลิกไฟล์ OK ปุ่ม

4 คลิกที่ OK ปุ่มใน แทรกไฮเปอร์ลิงก์ กล่องโต้ตอบเพื่อเสร็จสิ้นการสร้างไฮเปอร์ลิงก์

ตอนนี้คุณสามารถเห็นปลายหน้าจอที่แสดงเมื่อวางเมาส์เหนือรูปร่าง


เพิ่มเมาส์เหนือปลายเป็นรูปร่างบางอย่างด้วยรหัส VBA

คุณสามารถเพิ่มปลายเมาส์ให้เป็นรูปร่างที่ต้องการได้อย่างง่ายดายหลังจากเรียกใช้รหัส VBA ต่อไปนี้

1. เปิดแผ่นงานที่มีรูปร่างที่คุณจะแสดงเคล็ดลับเมื่อเลื่อนเมาส์ไป คลิกขวาที่แท็บแผ่นงานจากนั้นคลิก View Code จากเมนูบริบท

2 ใน Microsoft Visual Basic สำหรับแอปพลิเคชัน โปรดคัดลอกรหัส VBA ด้านล่างลงในหน้าต่างรหัส

รหัส VBA 1: เพิ่มเมาส์เหนือส่วนปลายเป็นรูปร่างที่แน่นอน

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Updated by Extendoffice 2018/3/30
    If Target.Address = Range("A1").Address Then
        Call MoveRow
    End If
End Sub

3 คลิก สิ่งที่ใส่เข้าไป > โมดูล. จากนั้นป้อนรหัส VBA ด้านล่างลงในหน้าต่างโมดูล

รหัส VBA 2: เพิ่มเมาส์เหนือส่วนปลายเป็นรูปร่างที่แน่นอน

Sub Text()
'Updated by Extendoffice 2018/3/30
    Dim xShape As Shape
    Dim xRg As Range
    On Error Resume Next
    Application.EnableEvents = False
    Set xShape = ActiveSheet.Shapes("Rectangle 4")
    If Not xShape Is Nothing Then
        ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
    End If
    If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
        Call MoveRow
    End If
    Application.EnableEvents = True
End Sub

หมายเหตุ / รายละเอียดเพิ่มเติม:

1). โปรดแทนที่ "คลิกเพื่อเรียกใช้ Macro"และ"สี่เหลี่ยมผืนผ้า 4” พร้อมข้อความคำแนะนำบนหน้าจอของคุณและชื่อของรูปร่างที่ต้องการ
2). แทนที่ "ย้ายแถว"ในบรรทัด"เรียก MoveRow"กับชื่อมาโครที่คุณกำหนดให้กับรูปร่าง

3 กด F5 กุญแจสำคัญในการเรียกใช้รหัส จากนั้นปลายหน้าจอที่ระบุจะถูกเพิ่มลงในรูปร่างที่แน่นอนทันที


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

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

🤖 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
Convert your shape to an image. Images have tool tips.
This comment was minimized by the moderator on the site
Doesn't work..... if there is a hyperlink associated with the shape then the macro will not run....
This comment was minimized by the moderator on the site
Dear Niall,
Sorry for the mistake. Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
Dear Niall,
The code works well in my case. Can you provide your Office version? Thank you for your comment.
This comment was minimized by the moderator on the site
Hello, Sub Test() On Error Resume Next Dim xShape As Shape Set xShape = ActiveSheet.Shapes("Rectangle 4") If Not xShape Is Nothing Then _ ActiveSheet.Hyperlinks.Add xShape, "", "", ScreenTip:="Click to run Macro " End Sub Thank code works great, but it removes Assigned macro. When i use Screen Tip and press on shape Macro Deosn't work. Is any way to fix that? Use Screen tip on shape and keep macro working? Thank youĄ
This comment was minimized by the moderator on the site
Dear Evaldas,
Sorry for the mistake. Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
I wish someone would solve this problem.
This comment was minimized by the moderator on the site
Good Day,
Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations