this is my code
how do i add that after email sent
i need to print the same data
Private Sub Worksheet_Change(ByVal Target As Range)
Macro1 Target 'event runs when cell in Column Pis added
End Sub
Private Sub Macro1(ByVal Target As Range)
If Target.Column = 16 And Target.Cells.Count = 1 Then
If Target.Value <> "" Then
result = MsgBox("pressing OK will send email to notify", vbOKCancel + vbExclamation, "Missing Approval")
If result = vbCancel Then SaveUI = True
If result = vbOK Then
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
On Error Resume Next
newmsg.Recipients.Add (Cells(Target.Row, "Z").Value) ' Add Recipients
newmsg.Recipients.Add (Cells(Target.Row, "AA").Value)
newmsg.Subject = Cells(Target.Row, "B").Value & " Reimbursement" ' Add Subject
newmsg.Body = "This is to inform you that payment has been processed " & _
"on behalf of " & Cells(Target.Row, "B").Value & "." & vbCrLf & "" & _
"Check # " & Cells(Target.Row, "P").Value & " was issued " & " for the amount of " & "$" & Cells(Target.Row, "Q").Value & ", " & _
"for services in the month of " & Cells(Target.Row, "C").Value & " for " & Cells(Target.Row, "F").Value & Cells(Target.Row, "G").Value & "." & vbCrLf & "" & _
"The check was mailed to " & Cells(Target.Row, "S").Value & "." & vbCrLf & "" & _
"(This check may contain multiple reimbursement requests and bills.)" ' Email Body
newmsg.Display 'Display Email
newmsg.Send 'Send Email
MsgBox "Outlook message sent", , "Outlook message sent" ' Confirm Sent Email
End If
End If
End If
End Sub
how do i add that after email sent
i need to print the same data
Private Sub Worksheet_Change(ByVal Target As Range)
Macro1 Target 'event runs when cell in Column Pis added
End Sub
Private Sub Macro1(ByVal Target As Range)
If Target.Column = 16 And Target.Cells.Count = 1 Then
If Target.Value <> "" Then
result = MsgBox("pressing OK will send email to notify", vbOKCancel + vbExclamation, "Missing Approval")
If result = vbCancel Then SaveUI = True
If result = vbOK Then
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
On Error Resume Next
newmsg.Recipients.Add (Cells(Target.Row, "Z").Value) ' Add Recipients
newmsg.Recipients.Add (Cells(Target.Row, "AA").Value)
newmsg.Subject = Cells(Target.Row, "B").Value & " Reimbursement" ' Add Subject
newmsg.Body = "This is to inform you that payment has been processed " & _
"on behalf of " & Cells(Target.Row, "B").Value & "." & vbCrLf & "" & _
"Check # " & Cells(Target.Row, "P").Value & " was issued " & " for the amount of " & "$" & Cells(Target.Row, "Q").Value & ", " & _
"for services in the month of " & Cells(Target.Row, "C").Value & " for " & Cells(Target.Row, "F").Value & Cells(Target.Row, "G").Value & "." & vbCrLf & "" & _
"The check was mailed to " & Cells(Target.Row, "S").Value & "." & vbCrLf & "" & _
"(This check may contain multiple reimbursement requests and bills.)" ' Email Body
newmsg.Display 'Display Email
newmsg.Send 'Send Email
MsgBox "Outlook message sent", , "Outlook message sent" ' Confirm Sent Email
End If
End If
End If
End Sub