Results 1 to 2 of 2

Thread: Please Help ! "Birthday Emails to be sent on Sat/Sun"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Oct 2022
    Posts
    1
    Location

    Question Please Help ! "Birthday Emails to be sent on Sat/Sun"

    Hi, I don't know much about coding....just the beginner.
    Want to send birthday wishes to all team members. I have got the vba coding which helps me to send the wishes with image at the time I open the excel workbook. However I am still stuck... if the birthday falls on Saturday or Sunday, then how I can figure this out. Also If i open the workbook more than once in a day ...it resend as many times I open it. Please help me with these.

    Sub Bdwishes()
    Dim i as long
    Dim ws as worksheet
    Dim sendmessage as boolean
    Set ws= this.workbook.sheets("sheet1")
    With ws
    For i=2 to .Range("A" & Rows.count).End(xlUp).Row
    Send message=True
    Birthday=Cdate(.Range("C" & i).value
    Select Case True
    Case Day(now())= Day(Birthday) And Month(Now()) = Month(Birthday)
    'birthday this day
    Sendmessage=True
    End Select
    If SendMessage Then Call SendBDay(Range("a" & i).value, Range("b" & i)
    next i
    End with
    End Sub
    Last edited by Aussiebear; 10-18-2022 at 02:38 AM. Reason: Added code tags to supplied code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •