hi i think this qualifies as a new question
i got help with this message box but it is giving me a run time error and crashes my system
i think the issue is that it isnt allowing a new line entry because immediately it runs the code on the line with the first cell entry
i need that this code should run only if the columns 5 and 6 are filled in with the parameters listed
If Target.Cells.Count = 1 Then
i need to add code here to say only activate code if column A <> "" and columns 5 and 6 have been filled in (really just to activate if column 5 and 6 were filled in with the parameters and ignore all other line entries)
If Target.Column = 5 And Target.Cells.Value = "_Approvals Missing" And Target.Cells.Offset(0, 1).Value <> "" Or _
Target.Column = 6 And Target.Cells.Offset(0, -1).Value = "_Approvals Missing" And Target.Cells.Value <> "" Then
result = MsgBox("pressing OK will send email to notify", vbOKOnly + vbExclamation, "Missing Approval")
If result = vbOK Then
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
newmsg.Recipients.Add ("mail@mail.org") ' Add Recipients
newmsg.Subject = "Missing Approval" ' Add Subject
newmsg.Body = "Missing Approval" & vbCrLf & "" & _
"Please get approval for " & _
Cells(Target.Row, "A").Value & _ Will this code use the info filled into column A of the same row
" for Missing Class/Membership: " & _
Target.Cells.Offset(0, 1).Value ' 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
i got help with this message box but it is giving me a run time error and crashes my system
i think the issue is that it isnt allowing a new line entry because immediately it runs the code on the line with the first cell entry
i need that this code should run only if the columns 5 and 6 are filled in with the parameters listed
If Target.Cells.Count = 1 Then
i need to add code here to say only activate code if column A <> "" and columns 5 and 6 have been filled in (really just to activate if column 5 and 6 were filled in with the parameters and ignore all other line entries)
If Target.Column = 5 And Target.Cells.Value = "_Approvals Missing" And Target.Cells.Offset(0, 1).Value <> "" Or _
Target.Column = 6 And Target.Cells.Offset(0, -1).Value = "_Approvals Missing" And Target.Cells.Value <> "" Then
result = MsgBox("pressing OK will send email to notify", vbOKOnly + vbExclamation, "Missing Approval")
If result = vbOK Then
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
newmsg.Recipients.Add ("mail@mail.org") ' Add Recipients
newmsg.Subject = "Missing Approval" ' Add Subject
newmsg.Body = "Missing Approval" & vbCrLf & "" & _
"Please get approval for " & _
Cells(Target.Row, "A").Value & _ Will this code use the info filled into column A of the same row
" for Missing Class/Membership: " & _
Target.Cells.Offset(0, 1).Value ' 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