I know this is basic vb knowledge. sorry. how can I add both of these commands to this macro:
object:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("a3"), rng) Is Nothing Then
If Range("a3").Value > 200 Then EmailBDayReminder
End If
End If
EndMacro:
End Sub
module:
Sub Mail_with_outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strto = "xxx@verizon.net"
strcc = ""
strbcc = ""
strsub = "Birthday Announcement!"
strbody = Range("c2") & " " & Range("e2") & " " & "on" & " " & Range("a2")
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
object:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("a3"), rng) Is Nothing Then
If Range("a3").Value > 200 Then EmailBDayReminder
End If
End If
EndMacro:
End Sub
module:
Sub Mail_with_outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strto = "xxx@verizon.net"
strcc = ""
strbcc = ""
strsub = "Birthday Announcement!"
strbody = Range("c2") & " " & Range("e2") & " " & "on" & " " & Range("a2")
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Last edited by a moderator: