ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding a range of cells to match a date (https://www.excelbanter.com/excel-programming/272101-re-finding-range-cells-match-date.html)

Tom Ogilvy

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






All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com