Я пытаюсь выполнить код проверки ошибок, который проверяет, правильно ли завершены некоторые конкретные ячейки, перед запуском более сложного кода.
Пока что я написал следующий код:
Dim tabel As Range
Set tabel = ActiveDocument.Sections(2).Range
tabel.Select
Dim oCel As Cell
With ActiveDocument.Tables(1).Columns(3)
For Each oCel In .Cells
Selection.Find.Execute FindText:="Petent"
If Selection.Find.Found = False Then
MsgBox "Intr-un dosar nu este inregistrat Petent"
End If
Next
End With
tabel.Select
With ActiveDocument.Tables(1).Columns(3)
For Each oCel In .Cells
Selection.Find.Execute FindText:="Creditor"
If Selection.Find.Found = False Then
MsgBox "Intr-un dosar nu este inregistrat Creditor"
End If
Next
End With
tabel.Select
With ActiveDocument.Tables(1).Columns(3)
For Each oCel In .Cells
Selection.Find.Execute FindText:="Debitor"
If Selection.Find.Found = False Then
MsgBox "Intr-un dosar nu este inregistrat Debitor"
End If
Next
End With
Выполняя пошаговую отладку, я обнаружил, что, когда определенное слово не найдено в ячейке, оно переходит к следующей ячейке, не отображая сообщение.
В чем проблема в этом случае?