View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default finding a range of cells to match a date

Dim res as Variant
Dim rng as Range
Dim dtVal as Date
dtVal = DateSerial(2003,07,10)
set rng = Range("B9:B200")
res = application.Match(clng(dtVal),rng,0)
if not iserror(res) then
msgbox "Match for " & format(dtVal,"mm/dd/yyyy") & _
" found at row " & rng(res).row
Else
msgbox "Date not found"
End if

--
Regards,
Tom Ogilvy


LADS wrote in message
...
How would I match on a value, applied on a range of cells in a separate
column to match the range of rows containing the value? The cell I want to
match to is a function of date format. The column is of date format.

Thanks,
Tom