VBA IfError出错

时间:2018-05-09 00:39:38

标签: vba excel-vba excel

我可能会失明,但在IfError&#39>中出现错误时,我收到类型不匹配错误

Dim LastRow As Long
LastRow = AMT.Cells(Rows.Count, 2).End(xlUp).Row
Dim i As Integer
Dim j As Integer

For i = 11 To LastRow
    j = i - 1
If IsEmpty(Cells(i, 7)) = True Then

    Cells(i, 9).Value = Application.WorksheetFunction.IfError(Cells(9, 9) * Cells(i, 1) + Cells(j, 14), Cells(9, 9) * Cells(i, 1))
Else
    Cells(i, 9).Value = Application.WorksheetFunction.IfError(Cells(i, 7) * Cells(i, 1) + Cells(j, 14), Cells(i, 7) * Cells(i, 1))
End If

Next i

0 个答案:

没有答案