Creating a double lookup

K

Kenton

I need some assistance on creating a "double lookup." Essentially what I am
trying to do is the following:
Object: retrieve a number from multiple lists determined by company name and
date.
Source data would include a company name i.e. company A, B, or C and also
the date an order was placed. Those two criteria would need to be used in
order to determine the retrieved number.
For example, if the order is for company B on 08/28/08. I would need to
create a lookup that retrieves a number from list B for that date or later.
Any help would be much appreciated. Thank you.
 
G

GTVT06

Here is something I put together if the company name is in A1:A23, the
date is in column B, and the number to retrieve is in column C

Option Explicit
Sub test()
Dim cell As Range
Dim Co As String
Dim Dte As Date
Co = InputBox("Company Name")
Dte = InputBox("Date")
For Each cell In Range("A1:A23")
If cell.Value = Co Then
If cell.Offset(0, 1).Value = Dte Then
MsgBox cell.Offset(0, 2).Value
End If
End If
Next cell
End Sub
 
K

Kenton

Still a little confused here. If anyone else could provide any additional
help, I would greatly appreciate it. Thanks.
 
K

Kenton

Thank you. Thank you. I had to enter some additional information, i.e. fill
in all the dates as I was not doing a lookup but with that one small
exception this works perfectly. Thanks again.
 
Top