title: Excel cannot find dates (regardless of formatting options)
body: <p>My boss keeps a small excel file that mimics the desk calendar we use to keep track of random things at our job, like hours and counts of reports sent. It's laid out in a grid of 7x5 (roughly 5, the last row only has a few cells in it since the months aren't generally divisible by 7).</p>
  <p>How the dates and such work is the first cell, A1, has the first date of the month. Each subsequent cell was hand-coded by my boss to take the value of the date cell in the tile before it and add 1. However, these cells aren't side-by-side, they are splayed out. I am trying to get it to sum each weeks total hours (and reports), but when I attempt to call the <code>Cells.Find</code> method, it doesn't return anything.</p>
  <p>I thought that perhaps it was because the cells are formatted in the American fashion of <code>mm/dd/yy</code>, so I tried to search for <code>05/12/14</code> and it didn't work. So I attempted to search for the default date format that the <code>Date()</code> function returns, <code>m/d/yyyy</code>, and it still doesn't find anything. I've tried to set the <code>.Find()</code> to check both Values and Formulas, and neither works. Even if I use the <code>ctrl+F</code> to find them by hand, it tells me there is no such value in the work sheet.</p>
  <p>I've searched around, and none of the posts that I found had a solution that worked - the <code>Cells.Find</code> method always returns either <code>A1</code>, the first time it is called, or <code>Nothing</code> on every subsequent call.</p>
  <p>My code currently is minimal, but here it is.</p>
  <h2>Code</h2>
  <pre><code> Sub Worksheet()
      Dim r As Range, d As Date, fwkn As Integer, lwkn As Integer, wkn As Integer, col As Collection
      'The purpose of this is to get the week totals using the below functions.
      
      d = DateValue([A1].Value)
      fwkn = WeekNum(d) 'First week number
      d = DateSerial(Year(d), month(d) + 1, 1) - 1 'Gets us the last day of the month
      lwkn = WeekNum(d) 'Last Week Number
      last_of_month = Day(d)
      For i = 1 To last_of_month
      
          d = DateSerial(Year(d), month(d), i)
          Set r = Cells.Find(What:=d, LookIn:=xlFormulas, LookAt:=xlWhole, After:=Range(&quot;a1&quot;))
          If Not r Is Nothing Then
              Debug.Print r.Address
          End If
      
      Next
      
  End Sub
  Function WeekNum(d As Date) As Integer
  ' You can see examples of this at
  ' http://www.cpearson.com/excel/weeknum.htm
     WeekNum = CInt(Format(d, &quot;ww&quot;, vbMonday))
  End Function
  </code></pre>
  <p>Does anyone have any idea why Excel wouldn't find the date?</p>