First you need to check that the cell contains an error:
If IsError(MyTab(i, j).Value) Then
If MyTab(i, j).Value <> CVErr(xlErrNA) Then
If you do not want to know the type of error (# N / A, # DIV / 0 !, etc.), you can also replace your test:
If (Not IsEmpty(MyTab.value)) And (Not IsError(MyTab(i, j).value)) Then
If you need to check the type of error, you can write:
Dim shouldBuildRequest As Boolean
shouldBuildRequest = Not IsEmpty(MyTab.value)
If IsError(MyTab(i, j).Value) Then
shouldBuildRequest = shouldBuildRequest AND (MyTab(i, j).Value <> CVErr(xlErrNA))
End If
If shouldBuildRequest Then
Call BuildRequest(False, id, MyTab, i, j)
End If
source
share