Hi Excel Gurus,
I need help with this small code.
I know how to find a date from a range. I tried using the same code where the date is derived through a formula (I am adding up date by 1 day to each subsequent cells and use "FIND" in this range to get the column of the date). Surprisingly the code didn't work and not returning the col of the date after find.
[pre]
[/pre]
Thanks in advance,
Regards,
Ravi.
I need help with this small code.
I know how to find a date from a range. I tried using the same code where the date is derived through a formula (I am adding up date by 1 day to each subsequent cells and use "FIND" in this range to get the column of the date). Surprisingly the code didn't work and not returning the col of the date after find.
[pre]
Code:
Sub Sample()
TDate = Cells(1, 1)
TDate = CDate(TDate)
Set FoundCell = Range("2:2").Find(what:=TDate, LookIn:=xlFormulas)
On Error Resume Next
Col = FoundCell.Column
MsgBox Col
End Sub
Thanks in advance,
Regards,
Ravi.