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

วิธีกรองเซลล์ด้วยความคิดเห็นใน Excel

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

กรองเซลล์ด้วยความคิดเห็นโดยสร้างคอลัมน์ผู้ช่วยเหลือ


ลูกศรสีฟ้าฟองขวา กรองเซลล์ด้วยความคิดเห็นโดยสร้างคอลัมน์ผู้ช่วยเหลือ

หากต้องการกรองเฉพาะแถวที่แสดงความคิดเห็นคุณสามารถระบุเซลล์ความคิดเห็นด้วย ฟังก์ชันที่ผู้ใช้กำหนด ก่อนแล้วจึงใช้ไฟล์ ตัวกรอง ฟังก์ชัน

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

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางมาโครต่อไปนี้ในไฟล์ หน้าต่างโมดูล.

รหัส VBA: ระบุเซลล์ที่มีความคิดเห็น

Function HasComment(r As Range)
'Update 20140718
    Application.Volatile True
    HasComment = Not r.Comment Is Nothing
End Function

3. จากนั้นบันทึกรหัสและปิดไฟล์ โมดูล หน้าต่างและกลับไปที่แผ่นงานป้อนสูตรนี้ = HasComment (B2) ลงในเซลล์ว่างถัดจากเซลล์ข้อคิดเห็น (B2 มีค่าที่คุณต้องการใช้) ดูภาพหน้าจอ:

doc-ตัวกรองความคิดเห็น-1

4. จากนั้นลากจุดจับเติมไปยังเซลล์ช่วงที่คุณต้องการใช้สูตรนี้และคุณจะได้รับ TRUE or FALSE ในเซลล์ TRUE หมายถึงเซลล์ที่มีความคิดเห็นและ FALSE แสดงว่าไม่มีความคิดเห็น

5. หลังจากระบุเซลล์ข้อคิดเห็นแล้วให้เลือกช่วงข้อมูลจากนั้นคลิก ข้อมูล > ตัวกรองดูภาพหน้าจอ:

doc-ตัวกรองความคิดเห็น-1

6. จากนั้นคลิกลูกศรแบบเลื่อนลงข้างคอลัมน์ตัวช่วยตรวจสอบ TRUE ตัวเลือกเท่านั้นดูภาพหน้าจอ:

doc-ตัวกรองความคิดเห็น-1

7. และคลิก OK จากนั้นแถวความคิดเห็นจะถูกกรองออกตามภาพหน้าจอต่อไปนี้:

doc-ตัวกรองความคิดเห็น-1

8. ในที่สุดคุณสามารถลบเนื้อหาของคอลัมน์ C ได้ตามที่คุณต้องการ

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

🤖 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 (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am using Excel 365 and tried using Notes instead of Comments and I get #NAME?. When I try comments, I get all False. I confirmed that my cells have Comments and not Notes in the cells. What am I doing wrong?
This comment was minimized by the moderator on the site
Hello, Annie
In Excel 365, you can see the note is shown as below screenshot:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-comment-note-1.png

And the comment is shown as this:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-comment-note-2.png

So, if there are notes in your worksheet, you just use the code in this article and don't change any thing, then apply the formula you will get the correct results as below:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-comment-note-3.png

Please try, hope it can help you!
This comment was minimized by the moderator on the site
And how to do it with COMMENTS? Not NOTES.

Johnny
This comment was minimized by the moderator on the site
Me sale todo falso a que se debe
This comment was minimized by the moderator on the site
Hello Marcela,

Glad to help. May I know whether the Excel version you are using is Microsoft Excel 365, which can be different from other versions of Excel?

If it is Microsoft Excel 365, then I know what leads to the problem. In Microsoft Excel 365, Notes replaced the Comments in other versions of Excel. So change your comments to notes, then the returned values will be TRUEs. Please have a try. Looking forward to your reply.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
Hi, so how to do it with COMMENTS? Without changing them to notes.

Thx,
johnny.
This comment was minimized by the moderator on the site
Maravilhoso!!!!!! Obrigado!!!!
This comment was minimized by the moderator on the site
Gracias por este aporte, muy recomendado esta página.
This comment was minimized by the moderator on the site
I would like to know how does the "HasComment = Not r.Comment Is Nothing" part works. Thanks!
This comment was minimized by the moderator on the site
Amazing solution to a problem. Loved it.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations