Cell Echo Help Required

D

Dave_D

I previously sent this to the wrong newsgroup.

Is there a VBA routine that will echo back the cell
location based on the value in another cell ? For
example, consider the following

A B C D
1 101 110.5
2 102
3 103.9
4 104
5 110.5
6 121

I'm looking for the cell location for the value (110.5)
contained in cell C1 and place the returned location (A5)
in cell D1.
 
M

Myrna Larson

Sub Test()
Dim R As Variant
Dim Rng As Range
Set Rng = Range("A1:A100")
R = Application.Match(Range("C1").Value, Rng, 0)
If IsNumeric(R) Then
Range("D1").Value = Rng.Cells(R).Address
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top