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

วิธีการเลือกตารางทั้งหมดในเอกสาร Word

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


เลือกตารางทั้งหมดใน Word ด้วยรหัส VBA

เลือกตารางทั้งหมดใน Word ได้อย่างง่ายดายด้วย Kutools for Word


เลือกตารางทั้งหมดใน Word ด้วยรหัส VBA

1. กด อื่น ๆ + F11 คีย์เพื่อเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2. ในการเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่างคลิก สิ่งที่ใส่เข้าไป > โมดูลจากนั้นคัดลอกและวางโค้ด VBA ต่อไปนี้ลงในหน้าต่างโมดูล

รหัส VBA: เลือกตารางทั้งหมดในเอกสารปัจจุบัน:

Sub selecttables()
Dim mytable As Table

For Each mytable In ActiveDocument.Tables
mytable.Range.Editors.Add wdEditorEveryone
Next
ActiveDocument.SelectAllEditableRanges (wdEditorEveryone)
ActiveDocument.DeleteAllEditableRanges (wdEditorEveryone)
End Sub

3 กด F5 กุญแจสำคัญในการเรียกใช้รหัส

จากนั้นตารางทั้งหมดจะถูกเลือกในเอกสารปัจจุบันทันที


เลือกตารางทั้งหมดใน Word ได้อย่างง่ายดายด้วย Kutools for Word

เมื่อเทียบกับการใช้รหัส VBA เพื่อเลือกตารางทั้งหมดในเอกสาร Kutools for Word's เลือกตาราง ประโยชน์ใช้สอยค่อนข้างสะดวก คุณสามารถใช้คุณสมบัตินี้เพื่อเลือกตารางในส่วนที่เลือกหรือทั้งเอกสาร โปรดดำเนินการดังนี้:

Kutools สำหรับ Word : ด้วยโปรแกรมเสริม Word ที่มีประโยชน์มากกว่า 100 รายการ ทดลองใช้ฟรีไม่มีข้อจำกัดใน 60 วัน.

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

หมายเหตุ: สำหรับการเลือกตารางในการเลือกคุณต้องเลือกช่วงก่อนจากนั้นจึงใช้คุณสมบัติ

จากนั้นคุณจะเห็นผลลัพธ์ดังนี้

เลือกตารางที่เลือก:

เลือกตารางในเอกสารทั้งหมด:

หากคุณต้องการทดลองใช้ยูทิลิตีนี้ฟรีโปรดไปที่ ดาวน์โหลดซอฟต์แวร์ฟรี ก่อนแล้วไปใช้การดำเนินการตามขั้นตอนข้างต้น


Demo: เลือกตารางทั้งหมดใน Word ได้อย่างง่ายดายด้วย Kutools for Word


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

Kutools สำหรับ Word - ยกระดับประสบการณ์คำศัพท์ของคุณด้วย Over 100 คุณสมบัติเด่น!

🤖 Kutools ผู้ช่วย AI: แปลงโฉมงานเขียนของคุณด้วย AI - สร้างเนื้อหา  /  เขียนข้อความใหม่  /  สรุปเอกสาร  /  สอบถามข้อมูล ขึ้นอยู่กับเอกสารทั้งหมดนี้ภายใน Word

📘 ความเชี่ยวชาญด้านเอกสาร: แยกหน้า  /  ผสานเอกสาร  /  ส่งออกตัวเลือกในรูปแบบต่างๆ (PDF/TXT/DOC/HTML...)  /  แบทช์แปลงเป็น PDF  /  ส่งออกเพจเป็นรูปภาพ  /  พิมพ์หลายไฟล์พร้อมกัน...

การแก้ไขเนื้อหา: ค้นหาแบทช์และแทนที่ ข้ามหลายไฟล์  /  ปรับขนาดรูปภาพทั้งหมด  /  ย้ายแถวและคอลัมน์ของตาราง  /  แปลงตารางเป็นข้อความ...

🧹 ทำความสะอาดได้อย่างง่ายดาย: หลบไป พื้นที่พิเศษ  /  แบ่งส่วน  /  ส่วนหัวทั้งหมด  /  กล่องข้อความ  /  เชื่อมโยงหลายมิติ  / หากต้องการดูเครื่องมือถอดเพิ่มเติม โปรดไปที่ของเรา ลบกลุ่ม...

ส่วนแทรกโฆษณา: แทรก ตัวคั่นหลักพัน  /  กล่องกาเครื่องหมาย  /  ปุ่มวิทยุ  /  คิวอาร์โค้ด  /  บาร์โค้ด  /  ตารางเส้นทแยงมุม  /  คำอธิบายสมการ  /  คำบรรยายภาพ  /  คำบรรยายตาราง  /  รูปภาพหลายภาพ  / ค้นพบเพิ่มเติมใน แทรกกลุ่ม...

🔍 การเลือกที่แม่นยำ: ระบุ หน้าที่เฉพาะเจาะจง  /  ตาราง  /  รูปร่าง  /  หัวเรื่องย่อหน้า  / เสริมการนำทางด้วย ข้อมูลเพิ่มเติม เลือกคุณสมบัติ...

การปรับปรุงดาว: นำทางอย่างรวดเร็วไปยังสถานที่ใด ๆ  /  แทรกข้อความซ้ำอัตโนมัติ  /  สลับระหว่างหน้าต่างเอกสารได้อย่างราบรื่น  /  11 เครื่องมือการแปลง...

???? ต้องการลองใช้คุณสมบัติเหล่านี้หรือไม่? Kutools for Word มีไฟล์ ทดลองใช้ฟรี 60 วันโดยไม่มีข้อจำกัด! 🚀
 
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Very nice method. Thank you
This comment was minimized by the moderator on the site
It seeems that this macros does not work in Word 2016
This comment was minimized by the moderator on the site
It works in Word 2016. What error are you getting?
This comment was minimized by the moderator on the site
I understand already. For correct work macros cursor must to be not in table when you call macros. Thank you.
This comment was minimized by the moderator on the site
There are multiple tables in a document (about 200). I want to select all these tables only and paste them in a new document in the table format. When I select the tables as per above procedure then during paste operation it pastes them as text and not as table. Can you please help me?
This comment was minimized by the moderator on the site
The following modified code selects all tables, except tables having only one row: Sub SelAllTbls() ActiveDocument.DeleteAllEditableRanges (-1) Dim Tbl As Table For Each Tbl In ActiveDocument.Tables If Tbl.Rows.Count > 1 Then Tbl.Range.Editors.Add (-1) End If Next ActiveDocument.SelectAllEditableRanges (-1) ActiveDocument.DeleteAllEditableRanges (-1) End Sub The following code select only the header rows: Sub selallHeaders() On Error Resume Next ActiveDocument.DeleteAllEditableRanges (-1) Dim Tbl As Table For Each Tbl In ActiveDocument.Tables Tbl.Rows(1).Range.Editors.Add (-1) Next ActiveDocument.SelectAllEditableRanges (-1) ActiveDocument.DeleteAllEditableRanges (-1) End Sub I have many more such codes that select last rows, all bullets, small / long paras, etc. Watch my following video: https://www.youtube.com/watch?v=p_ZhufliFw8
This comment was minimized by the moderator on the site
Wonderful I got the solution by using the VBA code. Thank you so much
This comment was minimized by the moderator on the site
Nifty code at first but it definitely corrupted a bunch of tables in Word 2010. Screwed up my file pretty good and had to revert back to an earlier version. Be wary!
This comment was minimized by the moderator on the site
excellent macro and very easy
This comment was minimized by the moderator on the site
thank you so much he is good program but after few days stopped and require password and user name
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations