View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed[_30_] Ed[_30_] is offline
external usenet poster
 
Posts: 13
Default Problem comparing dates

I have frequent problems with dates in Excel.

I declared "dat" as a date so,
"dim dat as date"

I loaded it with a value from a column of dates in "tlSht" so,
"dat=tkSht.Cells(r, 1)"

I then tried to find the same date in a column of dates in "mst:Sht" so,
"Set c = mstSht.Columns("A").Find(what:=dat)"

The above works only if both date columns are formatted in the same date
format and that is not feasible in my situation. I also tried using a
"string" and "double" variable instead of "date", but neither worked.

Can someone set me straight with this problem? Thanks!