ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding data in a Range / Returning Cell Location (https://www.excelbanter.com/excel-programming/273879-finding-data-range-returning-cell-location.html)

Betsy Jones

Finding data in a Range / Returning Cell Location
 
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

Alan Beban[_3_]

Finding data in a Range / Returning Cell Location
 
Post your code and indicate what happens when you run it.

Alan Beban

Betsy Jones wrote:
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



Betsy Jones

Finding data in a Range / Returning Cell Location
 


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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 05:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com