title: VBA to get previous working day
body: <p>I have created a VBA to automatically populate yesterday's date in a cell, but need assistance as how should get the date as 16th June(Friday) instead of 18th June(which is a Sunday) when I trigger it on Monday.  </p>
  
  <pre><code>`If .Column &lt;&gt; 11 Or .Row &lt; 1 Then Exit Sub
      If .Value = "Select" Then
          If .Offset(0, 1).Value = "" Then
              .Offset(0, 1).NumberFormat = "mm/dd/yy"
              .Offset(0, 1).Value = Now - 1
              .Offset(0, 2).Value = Now - 1
              .Offset(0, 2).NumberFormat = "mmm-yy" '&lt;~~ mmm-yy
              .Offset(0, 3).Value = GetMonthWeek(Now - 1)
          End If'
  </code></pre>