title: Autofill a column with month name depending on the date in another column - Excel VBA
body: <p>I'm new in working with Excel VBA and I have this problem.</p>
  
  <p>I would like my userform to autofill dynamic range in a column based on the date picked by the user. When the "create" button is clicked, simultaneously, on one column of the sheet the date is populated and on another column beside it, the Month name is also populated depending on the date encoded. Do you think it'll be possible? Your efforts will be greatly appreciated. Thanks!</p>
  
  <pre><code>Private Sub CommandButton1_Click()
      If Week &lt;&gt; "" Then
          Dim ws As Worksheet
          Dim LR1 As Long
          Dim LR3 As Long
          Dim LR4 As Long
  
          Set ws = ThisWorkbook.Sheets("Sheet1")
  
          ' get the last row from columns that has a value
          LR1 = ws.range("A" &amp; ws.Rows.Count).End(xlUp).Row
          LR3 = ws.range("C" &amp; ws.Rows.Count).End(xlUp).Row + 1
          LR4 = ws.range("D" &amp; ws.Rows.Count).End(xlUp).Row + 1
  
          ' use the last row to determine how far down to extend the formula
          ws.range("D" &amp; LR4 &amp; ":D" &amp; LR1).Value = Me.Week.Value
          ws.range("C" &amp; LR3 &amp; ":C" &amp; LR1).Value = Me.DTPicker1.Value
      Else
          MsgBox "Please fill all fields!"
      End If
      Unload Me
  End Sub
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/HqL1y.jpg" alt="Create Template GUI"></p>