you may also try this one:
Private Function FindDate2(dDate As String) As Range Dim srchFor As Variant Dim TargetCell As Range srchFor = DateValue(Format$(dDate, "mm/dd/yyyy")) 'Set TargetCell = Worksheets("DP").Cells(1, 1).Find(What:=dDate, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False) Set TargetCell = Worksheets("DP").Cells.Find(What:=CDate(dDate), After:=Range("A1"), LookIn:=xlFormulas _ , LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) If (Not TargetCell Is Nothing) Then Set FindDate2 = TargetCell End If End Function




Reply With Quote