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

วิธีซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันใน Excel

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

ซ่อนข้อผิดพลาดของสูตรเดียวที่ไม่สอดคล้องกันโดยละเว้นข้อผิดพลาด
ซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดในการเลือกด้วยรหัส VBA


ซ่อนข้อผิดพลาดของสูตรเดียวที่ไม่สอดคล้องกันโดยละเว้นข้อผิดพลาด

คุณสามารถซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันได้หนึ่งข้อต่อครั้งโดยไม่สนใจข้อผิดพลาดใน Excel กรุณาดำเนินการดังนี้

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

2 เลือก ละเว้นข้อผิดพลาด จากรายการแบบหล่นลงตามภาพด้านล่างที่แสดง

จากนั้นตัวบ่งชี้ข้อผิดพลาดจะถูกซ่อนทันที


ซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดในการเลือกด้วยรหัส VBA

วิธี VBA ต่อไปนี้สามารถช่วยคุณซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดในการเลือกในแผ่นงานของคุณ กรุณาดำเนินการดังนี้

1. ในแผ่นงานคุณต้องซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดให้กดปุ่ม อื่น ๆ + F11 พร้อมกันเพื่อเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

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

รหัส VBA: ซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดในแผ่นงาน

Sub HideInconsistentFormulaError()
    Dim xRg As Range, xCell As Range
    Dim xError As Byte
    On Error Resume Next
    Set xRg = Application.InputBox("Please select the range:", "KuTools For Excel", ActiveWindow.RangeSelection.Address, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    For Each xCell In xRg
        If xCell.Errors(xlInconsistentFormula).Value Then
            xCell.Errors(xlInconsistentFormula).Ignore = True
        End If
    Next
End Sub

3 กด F5 กุญแจสำคัญในการเรียกใช้รหัส ในการโผล่ขึ้นมา Kutools สำหรับ Excel โปรดเลือกช่วงที่คุณต้องการซ่อนข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดจากนั้นคลิกที่ไฟล์ OK ปุ่ม. ดูภาพหน้าจอ:

จากนั้นข้อผิดพลาดของสูตรที่ไม่สอดคล้องกันทั้งหมดจะถูกซ่อนจากช่วงที่เลือกทันที ดูภาพหน้าจอ:

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

🤖 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 (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello Crystal,

thank you very much for the code, its working now :)


Greets

speedy
This comment was minimized by the moderator on the site
Hello Crystal,

thank you for your testing time.

Do you use a basic old school (user formatted table) only or is it a table with a excel design and filter function in column head ?
Like shown here:
https://support.microsoft.com/de-de/office/%C3%BCbersicht-zu-excel-tabellen-7ab0bb7d-3a9e-4b56-a3c9-6c94334e492c

Latest is what I am using.

I can´t share my "programm" - its a financial tool for personal use.
The cells are with this content:
=HYPERLINK("https://www.domain.de/abc.html";"www")

Because each row has a another link, I´m getting the inconsistent errors.
I can hide it manually, but not with VBA.

I don´t know if your vba just works for a few seconds and then the errors appear again.
This comment was minimized by the moderator on the site
Hi speedy,
Many thanks for your feedback. The original code did not take into account the Table format data. The code has been updated as follows, please give it a try.

Sub HideInconsistentFormulaError()
'Updated by Extendoffice 20220902
    Dim xRg As Range, xCell As Range
    Dim xError As Byte
    On Error Resume Next
   Set xRg = Application.InputBox("Please select the range:", "KuTools For Excel", ActiveWindow.RangeSelection.Address, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    For Each xCell In xRg
        If xCell.Errors(xlEmptyCellReferences).Value Then
            xCell.Errors(xlEmptyCellReferences).Ignore = True
        ElseIf xCell.Errors(xlEvaluateToError).Value Then
            xCell.Errors(xlEvaluateToError).Ignore = True
        ElseIf xCell.Errors(xlInconsistentFormula).Value Then
            xCell.Errors(xlInconsistentFormula).Ignore = True
        ElseIf xCell.Errors(xlInconsistentListFormula).Value Then
            xCell.Errors(xlInconsistentListFormula).Ignore = True
        ElseIf xCell.Errors(xlListDataValidation).Value Then
           xCell.Errors(xlListDataValidation).Ignore = True
        ElseIf xCell.Errors(xlNumberAsText).Value Then
            xCell.Errors(xlNumberAsText).Ignore = True
        ElseIf xCell.Errors(xlOmittedCells).Value Then
            xCell.Errors(xlOmittedCells).Ignore = True
        ElseIf xCell.Errors(xlTextDate).Value Then
            xCell.Errors(xlTextDate).Ignore = True
        ElseIf xCell.Errors(xlUnlockedFormulaCells).Value Then
            xCell.Errors(xlUnlockedFormulaCells).Ignore = True
        End If
    Next
End Sub
This comment was minimized by the moderator on the site
Hello Crystal,

The newest Excel 365 Version 2207 (Build 15427.20210)
This comment was minimized by the moderator on the site
Hi speedy,
I have tested the code in the same version (2207 (Build 15425.20210)) and it stil works.
Can you upload a sample file of your data here?
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/365_version.png
This comment was minimized by the moderator on the site
Hello,

thank you for sharing your solution, but its not working in newest Excel 365
No VBA-Errors, but Excel still shows the inconsistent errors
This comment was minimized by the moderator on the site
Hi speedy,
Can you tell me the version of your Excel 365 you have?
I have tested the code in Excel 365 and it works well. so the problem cannot be reproduced.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations