I have the following method which finds the largest and smallest values in a range. I am then using those values to locate the actual cell they are in as I need to grab the value from the header cell of that column. The Range.Find is always returning Nothing even though the range being searched HAS A CELL WITH THAT VALUE.
Sub GetTopAndBottomFiveCommodities() Dim tempRange As Range, x As Integer, bestPnL As Double, worstPnL As Double Dim strTopRangeName As String, strBottomRangeName As String Dim cCell As Range, commodityName As String Set tempRange = dataSourceSheet.Range("A:A").Find(What:="Year Totals") Set tempRange = Range(tempRange.Offset(0, 1), tempRange.End(xlToRight).Offset(0, -1)) For x = 1 To 5 strTopRangeName = "TopCommodity" & CStr(x) strBottomRangeName = "BottomCommodity" & CStr(x) bestPnL = WorksheetFunction.Large(tempRange, x) worstPnL = WorksheetFunction.Small(tempRange, x) Debug.Print tempRange.Address ' get the top commodity name and PnL **Set cCell = tempRange.Find(What:=bestPnL, LookIn:=xlValues)** commodityName = dataSourceSheet.Cells(5, cCell.Column).Value Range(strTopRangeName).Value = commodityName Range(strTopRangeName).Offset(0, 1).Value = bestPnL Next x End Sub The code line
Set cCell = tempRange.Find(What:=bestPnL, LookIn:=xlValues) is always returning nothing but I have verified that there are cells with that value. One example, the cell value is 66,152.61 (displayed in cell as 66,153) and the bestPnL variable is 66,152.61 , so I tried rounding bestPnL to 66,153, but still didn't find it. The debug statement is showing tempRange has the right range, so its not searching in the wrong place.
The only thing I can think of is the cell with the value, gets its value from a very long formula, using over a dozen named ranges, can this be fouling the find method?
Just so we all know I'm not crazy, here is a snapshot of part of the range I'm searching where I'm testing.
EDIT Based on Tim Williams suggestion, I changed the number format of the range being searched prior to the Find call.
tempRange.NumberFormat = "0.00" and then the Find call works as it should. I then just put the number format back the way I want it at the end of the routine.
tempRange.NumberFormat = "$#,##0;[Red]$#,##0" Works as expected now.

What:=Cstr(bestPnL)see if it works?