N
NewToVB
I'm using visual studio to work with excel, Can anyone tell me why this isn't
working:
For i = 3 To lastRow Step 1
If
(LCV.WorksheetFunction.IsNA(LCV.WorksheetFunction.VLookup(LCV.Range("A" &
i).Value, oApp.Range("A1:J" & lastRow).Value, 10, False))) Then
LCV.Range("L" & i).Value = 0
Else : LCV.Range("L" & i).Value =
LCV.WorksheetFunction.VLookup(LCV.Range("A" & i).Value, oApp.Range("A1:J" &
lastRow).Value, 10, False)
End If
Instead of returning a zero where there is an N/A it just kicks me out of
the program. Any ideas? Thanks ahead of time!
working:
For i = 3 To lastRow Step 1
If
(LCV.WorksheetFunction.IsNA(LCV.WorksheetFunction.VLookup(LCV.Range("A" &
i).Value, oApp.Range("A1:J" & lastRow).Value, 10, False))) Then
LCV.Range("L" & i).Value = 0
Else : LCV.Range("L" & i).Value =
LCV.WorksheetFunction.VLookup(LCV.Range("A" & i).Value, oApp.Range("A1:J" &
lastRow).Value, 10, False)
End If
Instead of returning a zero where there is an N/A it just kicks me out of
the program. Any ideas? Thanks ahead of time!