title: Which is preferable; declaring & setting variable & calling twice, or calculating value on-the-fly twice?
body: <p>Which is the most efficient way to do this?</p>
  
  <pre><code>Sub pvaSetWeek(Optional weekOffset As Long = 0)
      Dim theDayToday As Long
  
      theDayToday = Weekday(Now, vbMonday)
  
      'Set start to Monday
      Range("pvaStartDate") = Int(Now) - (theDayToday - 1) - (weekOffset * 7)
  
      'Set end to Sunday
      Range("pvaEndDate") = Int(Now) + (7 - theDayToday) - (weekOffset * 7)
  End Sub
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Sub pvaSetWeek(Optional weekOffset As Long = 0)    
      'Set start to Monday
      Range("pvaStartDate") = Int(Now) - (Weekday(Now, vbMonday)- 1) - (weekOffset * 7)
  
      'Set end to Sunday
      Range("pvaEndDate") = Int(Now) + (7 - Weekday(Now, vbMonday)) - (weekOffset * 7)
  End Sub
  </code></pre>
  
  <p>And why?</p>
  
  <p>Edit to add: I usually go with the first way as it is easier to read/debug and obviously scales better if the same value needs used more than a couple of times, but where the value may only be used a few times I've often wondered if there is any penalty, however small, for doing things one way or another.</p>