代码实际上是在另一本工作簿的某个范围内寻找公式
以下代码为我提供了错误目标代码:在第6行上
With ws1
i = 6
Do Until .Cells(i, 3) = ""
If .Cells(i, 3).Value <> "NA" Then
Set rngStatus = rngLookup.Find(.Cells(i, 3).Value)
vCurrYear = rngStatus.EntireRow.Cells(1, 12).Formula
vPrevYear = rngStatus.EntireRow.Cells(1, 11).Formula
If Not IsError(v) Then .Cells(i, 5) = vCurrYear And .Cells(i, 4) = vPrevYear
End If
i = i + 1
Loop
End With