View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GTVT06 GTVT06 is offline
external usenet poster
 
Posts: 141
Default 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