Thread: searching date
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default searching date

Dim dDate as Date
Dim rng as Range
Dim res as Variant
dDate = DateValue("12/21/2002")
set rng = Range("C1:C200")
res = Application.Match(clng(dDate),rng,0)
if not iserror(res) then
rng(res).Value = activecell.value
End if

--
Regards,
Tom Ogilvy


"Irunalotta" wrote in message
...

Can someone show me how I would write code to search a worksheet for a
specific date and then paste my selection to the cell next to it.
Thanks.

-Jeremy


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements