下午好,
我想快速检查我的工作簿以检测潜在的#REF!值。
我在这里找到了一些很好的解决方案:
但是当我应用它时,它会更改找到的所有值。
我需要一些东西,它会通知我,不需要的值出现。
在这个事件中,我修改了以下代码:
Sub FindAndExecute()
Dim Sh As Worksheet
Dim Loc As Range
For Each Sh In ThisWorkbook.Worksheets
With Sh.UsedRange
Set Loc = .Cells.Find(What:="#REF!")
If Not Loc Is Nothing Then
Do Until Loc Is Nothing
If Loc = True Then
MsgBox ("Error found")
End If
'Loc.Value = "Answered!"
Set Loc = .FindNext(Loc)
Loop
End If
End With
Set Loc = Nothing
Next
End Sub
Run Code Online (Sandbox Code Playgroud)
但我看不到任何反应。当在整个工作簿中找到#REF 值时,有什么方法可以弹出消息框?