Finding data in a Range / Returning Cell Location

  • Thread starter Thread starter Betsy Jones
  • Start date Start date
B

Betsy Jones

I have set a Range in Worksheet2 called Master_Rate. From
within my VBA code I need to be able to locate the cell in
that range that contains a specific value and then return
the cell reference.

I have tried using the Find Method but am not gettng the
results I expected.

Thanks for any help

Betsy
 
Here is the code:

Function Find_Min_Rate()
Dim Cell As Range
WS2.Activate
Set Cell = Range("Master_Rates").Find(what:=MinRate, LookIn:=xlValues)
Cell.Select
MsgBox "Cell address is " & Cell.Address(RowAbsolute:=False,
ColumnAbsolute:=False)

End Function

It was 'sort of' working for a while. My range contains the values 6.000
thru 8.000 in increments of .125. If I searched for 6.125, I could
locate the cell. If I searched for searched for 7 it would find 6.750. I
think I can work around that (though I will take any suggestions.

HOWEVER - Some gremlin seems to have invaded by computer. Now it doesn't
seem to find a match whatever I do?

HELP.

Betsy
 
Back
Top