title: macro to check if value is in another list, and if so add today's date
body: <p>I have two excel sheets, A which contains products and B, which is the products we will discontinue when stock runs out.</p>
  
  <p>I would like a macro so that we can make a list in B, hit the run function, and it will go and find where it is in sheet A, go to column E of that row and enter in today's date.</p>
  
  <p>The hitch I have so far, is to not make it overwrite previous entries in the column if it wasn't found.</p>
  
  <p>The basic formula I have right now is this </p>
  
  <pre><code>Sub Deletions()
  Dim LastRow As Long
  With Sheets("A")   '&lt;-set this worksheet reference properly
      LastRow = .Range("A" &amp; Cells.Rows.Count).End(xlUp).Row
      With .Range("E2:E" &amp; LastRow)
          .Formula = "=IF(A1='B'!A1,TODAY(),)"
        .Cells = .Value2
      End With
  End With
  End Sub
  </code></pre>
  
  <p>The reason I need to use VBA, is that we have over 100k items, and not everyone using this will know excel very well. So we want to be able to make a list, put it in excel, and click the macro button and voila.</p>
  
  <p>Also, the list of removed items gets deleted afterwards, as the information is kept in sheet A. We also need to keep the dates of when products got discontinued, so it is very crucial that this macro not erase previous entries.</p>