Creating a double lookup
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
|