Might the VLOOKUP function be of use? It can be called from VBA with code
like
Dim Res As Variant
Res = Application.VLookup("b", Range("A1:B5"), 2, False)
If IsError(Res) = True Then
Debug.Print "Not Found"
Else
Debug.Print "Res: " & CStr(Res)
End If
The Range("A1:B5") can be any range on any sheet.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
"mattgyver83" wrote in message
ups.com...
Hello All,
Let me try to make a long story short. I have created a spreadsheet
that does fantastic things, however I want to be able to reference a
price from an ID Number after entering the ID into a cell on a
different sheet. This way I don't have to stare at a piece of paper to
figure out the price, which wastes man-time. The catch is there are a
lot of ID numbers to "Search". The price/ID info are on a separate
sheet. I'm thinking 'SumProduct', but do I have to create a function
in VBA to "search" them or is there an easier way?
If you can supply the logic, I can create the code. Or visa-versa. I
have tried without avail ":(
if that makes sense, Thanks!
If not, thanks for wasting your time!
-Titus.