Yes, I put in the error handling you suggested and I got the same error until I eliminated the "Worksheetfunction" from the code. Once I did that, my variable was set to an error value as if it did not find the data in the range. The problem is, that if I use VBA to grab a cell and set its' value to equal that lookup formula, it works and finds the data I am looking for.
So, the formula works and finds the correct data if I plug the formula into a cess. If I set a variable to equal that lookup, it doesn't fine the data??? I would like to try the .Find, but I am fairly clueless as to how that works. I have read all of the examples, but I don't understand how it's working. Can someone explain what this code (from the example) is doing?
Sub test()
Dim cl As Range, n As Range, mYStRow As Integer
Dim y(1 To 199), z As Integer
mYStRow = 2
For Each cl In Sheets("Percentiles").Range("H2:H200")
On Error Resume Next
For z = LBound(y) To UBound(y)
If y(z)(o) = cl(, -1) Then
mYStRow = y(z)(1) + 1: End If
Next
On Error GoTo 0
Set n = Sheets("DB_Import").Range("f" & mYStRow - 1 _
& ":f200").Find(cl(, -1))
If Not n Is Nothing Then
cl = n(, 14)
y(cl.Row - 1) = Array(n, n.Row)
Else: cl = "0"
End If
mYStRow = 2
Next
End Sub
Bookmarks