我已经制作了一个UDF,在Option Explicit
的模块中非常简单,我在标签用作错误处理的目标时遇到了错误:
编译错误:Sub或Function未定义
以下是代码:
Public Function IsRowEmpty(ByVal aArray As Variant, ByVal RowNumber As Long) As Boolean
Dim j As Integer
IsRowEmpty = True
On Error GoTo ErrHdl:
For j = LBound(aArray, 2) To UBound(aArray, 2)
If aArray(RowNumber, j) <> "" Then
IsRowEmpty = False
Exit Function
Else
End If
Next j
Exit Function
ErrHdl
IsRowEmpty = False
End Function
我环顾四周,但我似乎无法找到解决办法......
答案 0 :(得分:1)
您在:
代码
ErrHdl
Public Function IsRowEmpty(ByVal aArray As Variant, ByVal RowNumber As Long) As Boolean
Dim j As Integer
IsRowEmpty = True
On Error GoTo ErrHdl
For j = LBound(aArray, 2) To UBound(aArray, 2)
If aArray(RowNumber, j) <> "" Then
IsRowEmpty = False
Exit Function
Else
End If
Next j
Exit Function
ErrHdl:
IsRowEmpty = False
End Function