鉴于你最初的问题是,你如何发现与传统助产士合作手册的任何单元中的错误,你应当寻找一种非常有效的方法——检查每个单元都非常昂贵的时间!
这方面有两个选择:
- Use Excel s SpecialCells to shortcut the process
- use my Mappit! addin which is configured to report on spreadsheet errors
For SpecialCells please see the code below. This takes advantage of the ready-made collection of errors that exist as formulas
请将此constants也收集错误,这样,如果你在公式错误上复制了特别的过去,那么你需要使用。 Set rng1 = ws.Cells.SpecialCells (xlConstants, xlErrors)
,用于检测这些气体。
You can use also detect SpecialCells manually by
- Select all cells in the area of interest
- Press F5
- Click Special
- select Errors under Formulas (or Constants )
请注意,在xl2010年之前,有以下限制:8192地区,由特委会处理
Sub ErrorList()
Dim ws As Worksheet
Dim rng1 As Range
Dim strOut As String
For Each ws In ActiveWorkbook.Sheets
Set rng1 = Nothing
On Error Resume Next
Set rng1 = ws.Cells.SpecialCells(xlFormulas, xlErrors)
On Error GoTo 0
If Not rng1 Is Nothing Then strOut = strOut & (ws.Name & " has " & rng1.Cells.Count & " errors" & vbNewLine)
Next ws
If Len(strOut) > 0 Then
MsgBox "Error List:" & vbNewLine & strOut
Else
MsgBox "No Errors", vbInformation
End If
End Sub