Datepart Function

     

  • Returns part of date
  • Private Sub CommandButton1_Click()
    MsgBox DatePart("w", "1-oct-2016")
    MsgBox DatePart("d", "1-oct-2016")
    Range("A1").Value = Date
    Range("B1").Value = DatePart("d", Range("A1"))
    End Sub

     

    Download The Workbook