Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / April 2006

Tip: Looking for answers? Try searching our database.

lookup single value in entire worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jasonbennett07@yahoo.com - 13 Apr 2006 17:59 GMT
I have a single list of values (we'll call it A:A) that I need to find
where they exist in another worksheet (Sheet2A:IV).

Obviously, if I do a Vlookup (or Hlookup), it'll only look in row A on
Sheet2 for my specified value.  Is there a formula that will look in
all cells, in Sheet2, for a specific record in Sheet1?

Thanks for your help!!!
Gary''s Student - 13 Apr 2006 19:36 GMT
Try this little UDF:

Function where_is(r As Range) As String
Dim r2, r3 As Range
where_is = ""
v = r.Value
Set r2 = Worksheets("Sheet2").Range("A1:IV65536")
For Each r3 In r2
  If r3.Value = v Then
    where_is = r3.Address
    Exit Function
  End If
Next
End Function
Signature

Gary's Student

> I have a single list of values (we'll call it A:A) that I need to find
> where they exist in another worksheet (Sheet2A:IV).
[quoted text clipped - 4 lines]
>
> Thanks for your help!!!
jasonbennett07@yahoo.com - 13 Apr 2006 20:18 GMT
You are the man.  Or woman.  Whichever.

That is really cool, I need to learn how to do this stuff.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.