I'm getting crazy with that stuff and hope you can help me.
I have different cells in excel containing dates and when the opening-event is fired, i would like to find the cell containing today's date. To do so i use this code:
Set dCell = oSht.Range("A1:" & lastCell.Address).Find(What:=tDate, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
My problem is the date format. If i change the value in the find-function from "tDate" to "dd/mm/yyyy" it finds the cell, otherwise it doesn't. Where i live (Switzerland) the default date format is "dd.mm.yyyy" but even if use datevalue() or format(tDate, "dd/mm/yyyy") it still uses periods instead of slashes, because the variable tDate is defined as date. And as already said, if there is anything else than slashes it doesn't find the date.
How can i solve this problem?
This post has been edited by Anthonidas: 01 January 2013 - 04:54 PM