ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   searching date (https://www.excelbanter.com/excel-programming/284133-searching-date.html)

Irunalotta

searching date
 

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

-Jerem

-----------------------------------------------
~~ 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

Tom Ogilvy

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




All times are GMT +1. The time now is 03:24 AM.

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