date comparison problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tequilaman
    New Member
    • Oct 2007
    • 43

    date comparison problem

    Dim L As Date
    Dim T As Date
    Sheets("Overvie w").Select
    L = Worksheets(2).C ells(2, 12)

    If Today >= L Then
    ...


    The date in the cell is set to a day in 1986 and still the IF is never true. - Strange enough it only runs when I erase the date in the cell.

    Can anybody see why?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What is Today? Isn't the current date returned by Date$?

    Comment

    • Tequilaman
      New Member
      • Oct 2007
      • 43

      #3
      Thanks, I'll try that.

      I thought 'Today' is a public fuction, but maybe it was just one of the objects that I got very much used to.Now in a different environment missing my library...

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by Tequilaman
        I thought 'Today' is a public fuction, but maybe it was just one of the objects that I got very much used to.Now in a different environment missing my library...
        I hope it works. I'm on a really old version of Excel, so might just be out of date (no pun intended).

        Comment

        • Tequilaman
          New Member
          • Oct 2007
          • 43

          #5
          Well the Excel I was trying to do it is an old one too, it works. Many thanks!!!

          Comment

          Working...