create reminder in excel vba || Birthday Reminder

 How to create reminders in Excel VBA. very simple, through this process you can create any reminder like birthday reminders for students, staff, etc. in this tutorial.

Option Explicit Private Sub SpinButton1_SpinDown() On Error Resume Next Me.TextBox1.Value = Format(CDate(Me.TextBox1) - 1, "dd-mmm-yy") Me.Label4.Caption = Format(CDate(Me.TextBox1), "dddd") Call upcoming_birthday End Sub Private Sub SpinButton1_SpinUp() On Error Resume Next Me.TextBox1.Value = Format(CDate(Me.TextBox1) + 1, "dd-mmm-yy") Me.Label4.Caption = Format(CDate(Me.TextBox1), "dddd") Call upcoming_birthday End Sub Private Sub UserForm_Initialize() Me.Label3.Caption = Format(Date, "dddd") Me.TextBox1.Value = Format(Date + 1, "dd-mmm-yy") Me.Label4.Caption = Format(CDate(Me.TextBox1), "dddd") Dim sh As Worksheet Set sh = Sheets("AddressBook") With Me.ListBox1 .AddItem "Student Name" .List(0, 1) = "Father's Name" .List(0, 2) = "DOB" .List(0, 3) = "sex" .List(0, 4) = "Adm Date" .List(0, 5) = "Address" .List(0, 6) = "Class" .Selected(0) = True End With Dim r As Long For r = 2 To sh.Range("D10000").End(xlUp).Row If Format(sh.Cells(r, 4), "dd-mmm") = Format(Date, "dd-mmm") Then With Me.ListBox1 .AddItem sh.Cells(r, 2) .List(.ListCount - 1, 1) = sh.Cells(r, 3) .List(.ListCount - 1, 2) = sh.Cells(r, 4) .List(.ListCount - 1, 3) = sh.Cells(r, 5) .List(.ListCount - 1, 4) = sh.Cells(r, 6) .List(.ListCount - 1, 5) = sh.Cells(r, 7) .List(.ListCount - 1, 6) = sh.Cells(r, 9) End With End If Next r Call upcoming_birthday End Sub

----------------------------------------------------------------------------------------------------
Module
____________________________________________________________

Option Explicit Sub upcoming_birthday() Dim sh As Worksheet Set sh = Sheets("AddressBook") UserForm4.ListBox2.Clear With UserForm4.ListBox2 .AddItem "Student Name" .List(0, 1) = "Father's Name" .List(0, 2) = "DOB" .List(0, 3) = "sex" .List(0, 4) = "Adm Date" .List(0, 5) = "Address" .List(0, 6) = "Class" .Selected(0) = True End With Dim r As Long For r = 2 To sh.Range("D10000").End(xlUp).Row If Format(sh.Cells(r, 4), "dd-mmm") = Format(CDate(UserForm4.TextBox1), "dd-mmm") Then With UserForm4.ListBox2 .AddItem sh.Cells(r, 2) .List(.ListCount - 1, 1) = sh.Cells(r, 3) .List(.ListCount - 1, 2) = sh.Cells(r, 4) .List(.ListCount - 1, 3) = sh.Cells(r, 5) .List(.ListCount - 1, 4) = sh.Cells(r, 6) .List(.ListCount - 1, 5) = sh.Cells(r, 7) .List(.ListCount - 1, 6) = sh.Cells(r, 9) End With End If Next r End Sub`

`

No comments:

Post a Comment