title: VBA Run Macro Once a Day
body: <p>I need some code to run a macro just once a day, it doesn't matter how many times you open the file where is the macro.</p>
  
  <p>If the file is not opened one day it doesn't have to run the macro, just do it when it is opened. </p>
  
  <p>It has to have a ¨internal" variable or something like that, I guess, that keeps the info whether the macro has alredy run or not this day.</p>
  
  <p>Besides, to make it more difficult, I suppose, the macro open a different Workbook each day.</p>
  
  <p>Any thoughts.</p>
  
  <p>I am novice, so forgive me if that is so clear. Thanks in advance.</p>
  
  <p>EDITED: I found some code <a href="http://www.mrexcel.com/forum/excel-questions/560086-how-run-macro-first-time-workbook-opened-date.html" rel="nofollow">here</a>: </p>
  
  <p>that seems to do it but you have to create an extra sheet, I would like to dont do that.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Private Sub Workbook_Open()
  Dim rngFindTodaysDate As Range
      With ThisWorkbook.Worksheets("Status")
  
          On Error GoTo X
          Set rngFindTodaysDate = .Range("A1").End(xlDown).Find(Date)
          If rngFindTodaysDate Is Nothing Then
              .Range("A" &amp; .Range("A" &amp; Rows.Count).End(xlUp).Row + 1) = Date
  
              '''''  your Code  Here
  
          End If
      End With
      X:
  End Sub
  </code></pre>