Saquib
10-18-2022, 02:21 AM
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
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