title: Excel VBA macro to count the number of times a specific word appears according to a date (that would be converted to week number)
body: <p>So I have column A (contains the word) and column C (contains the date) shown below. The columns are occasionally separated by new headers, such as  for "Word" and "Date" and a blank space.</p>
  
  <pre><code>Word               Date
  BV                 12/06/2017
  BV                 12/06/2017
  BV                 13/06/2017
  BV                 13/06/2017
  BR                 17/07/2017
  BR                 17/07/2017
  BR                 24/07/2017
  
  Word               Date
  BT                 30/07/2017
  BT                 30/07/2017
  
  Word               Date
  BY                 05/08/2017
  </code></pre>
  
  <p>First the date would be converted in terms of week number into a new column D, such as 12/06/2017 to week 24.</p>
  
  <p>Using something like:</p>
  
  <pre><code>Sub TimeConverter()    
    Dim I as Long, MaxRow as Long
    MaxRow = Range("A" &amp; Rows.count).End(xlUp).Row
    For I = 2 to MaxRow
      Cells(I, "D").Value = DatePart("ww", Cells(I, "C"), 7)
    Next 
  End Sub
  </code></pre>
  
  <p>Then I would like the VBA macro code to look through column A and find the number of times a word appears and match with a date on the same week number into a new column B.</p>
  
  <p>Using something like:</p>
  
  <pre><code>=COUNTIF(A:A, "BV")
  =COUNTIF(A:A, "BR")
  
  Output
  # 4
  # 3
  </code></pre>
  
  <p>Now to then combine them together so that the unique word (column A) counts (column B) can be separated into the corresponding week number (column D).</p>
  
  <p><strong>Desired Output:</strong></p>
  
  <pre><code>BV      4      24
  BR      2      29
  BR      1      30
  BT      2      30
  BY      1      31
  </code></pre>
  
  <p>Any suggestion would be great! 
  Thank you.</p>