megha
04-22-2015, 11:26 AM
I have a following code created by someone and i want to add one "MsgBox" that says "your message has been sent" after they click accept or decline button. My question is - where and how do i add this in following two script? Can someone please help? Thank you in advance.
Here is the code:
Sub Accepted_Sendemail()
Dim operator_pass As String
Dim supervisor_pass As String
Dim pass As String
operator_pass = "bw"
supervisor_pass = "fls"
repeat:
pass = TEST
If (pass = operator_pass) Then
email_operator ("I Accept")
ElseIf (pass = supervisor_pass) Then
email_supervisor ("I Accept")
ElseIf (pass = "") Then
GoTo clse
Else
MsgBox ("please enter correct password")
GoTo repeat
End If
ActiveWorkbook.Close SaveChanges:=False
clse:
MsgBox ("Your message is not sent please select the options again for accepting or declining")
End Sub
Sub Declined_Sendemail()
Dim pass As String
Dim operator_pass As String
Dim supervisor_pass As String
operator_pass = "wrr"
supervisor_pass = "fls"
repeat:
pass = TEST
Dim reason As String
If (pass = operator_pass) Then
reason = InputBox("Reason for declining")
reason = "I Decline" & Chr(13) & Chr(10) & "REASON:" & Chr(13) & Chr(10) & reason
email_operator (reason)
ElseIf (pass = supervisor_pass) Then
reason = InputBox("Reason for declining")
reason = "I Decline" & Chr(13) & Chr(10) & "REASON:" & Chr(13) & Chr(10) & reason
email_supervisor (reason)
ElseIf (pass = "") Then
GoTo clse
Else
MsgBox ("please enter correct password")
GoTo repeat
End If
ActiveWorkbook.Close SaveChanges:=False
clse:
MsgBox ("Your message is not sent please select the options again for accepting or declining")
End Sub
Here is the code:
Sub Accepted_Sendemail()
Dim operator_pass As String
Dim supervisor_pass As String
Dim pass As String
operator_pass = "bw"
supervisor_pass = "fls"
repeat:
pass = TEST
If (pass = operator_pass) Then
email_operator ("I Accept")
ElseIf (pass = supervisor_pass) Then
email_supervisor ("I Accept")
ElseIf (pass = "") Then
GoTo clse
Else
MsgBox ("please enter correct password")
GoTo repeat
End If
ActiveWorkbook.Close SaveChanges:=False
clse:
MsgBox ("Your message is not sent please select the options again for accepting or declining")
End Sub
Sub Declined_Sendemail()
Dim pass As String
Dim operator_pass As String
Dim supervisor_pass As String
operator_pass = "wrr"
supervisor_pass = "fls"
repeat:
pass = TEST
Dim reason As String
If (pass = operator_pass) Then
reason = InputBox("Reason for declining")
reason = "I Decline" & Chr(13) & Chr(10) & "REASON:" & Chr(13) & Chr(10) & reason
email_operator (reason)
ElseIf (pass = supervisor_pass) Then
reason = InputBox("Reason for declining")
reason = "I Decline" & Chr(13) & Chr(10) & "REASON:" & Chr(13) & Chr(10) & reason
email_supervisor (reason)
ElseIf (pass = "") Then
GoTo clse
Else
MsgBox ("please enter correct password")
GoTo repeat
End If
ActiveWorkbook.Close SaveChanges:=False
clse:
MsgBox ("Your message is not sent please select the options again for accepting or declining")
End Sub