Please edit this macro for me, vbYesNo, thanks

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
;):)mY current code is:

sub pedies_vbyesno()
Dim Responce As VbMsgBoxResult
If Sheets("home").Range("C40").Value = "Declined" Then
Responce = MsgBox("Attention! Staffing Status States 'Declined', are you sure you want to update the tracker, if so please Click Yes or No to Discontinue", vbYesNo, "Question")
Else
GoTo skip:
End If
If Responce = vbYes Then
skip:
'
'MY CODE:
Else
MsgBox "Thank you!"
End If
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Perhaps

Code:
Sub pedies_vbyesno()
Dim Responce As VbMsgBoxResult
If Sheets("home").Range("C40").Value = "Declined" Then
    Responce = MsgBox("Attention! Staffing Status States 'Declined'," & vbNewLine & "Are you sure you want to update the tracker, if so please Click Yes or No to Discontinue", vbYesNo, "Question")
End If
If Responce = vbYes Then
    'MY CODE:
Else
    MsgBox "Thank you!"
End If
End Sub
 
Upvote 0
Oh my madness....sorry

to the current code i want edit it as follows
I just want to add one more thing. Here the pop up only come only when c40 = "Declined"
.
Please add a code so that when there is "Yes" in sheets("Home").range("C41"
) then msgbox "Attention! there is someone already
going for same? To continue click Yes"
So if c40 = declined or if c41 = yes, then pop up msg otherwise directly run my code.
THanks again!
 
Upvote 0
Try

Code:
Sub pedies_vbyesno()
Dim Responce As VbMsgBoxResult
If Sheets("home").Range("C40").Value = "Declined" Then
    Responce = MsgBox("Attention! Staffing Status States 'Declined'," & vbNewLine & "Are you sure you want to update the tracker, if so please Click Yes or No to Discontinue", vbYesNo, "Question")
Else
    Exit Sub
End If
If Responce = vbYes Then
    'MY CODE:
Else
    MsgBox "Thank you!"
End If
If Sheets("home").Range("C41").Value = "Yes" Then
    Responce = MsgBox("Attention! there is someone already going for same?" & vbNewLine & "To continue click Yes", vbYesNo, "Question")
Else
    Exit Sub
End If
If Responce = vbYes Then
    'MY CODE:
Else
    MsgBox "Thank you!"
End If
End Sub
 
Upvote 0
No. I work for a research, testing and consultancy company operating in the UK water supply industry.
 
Upvote 0
Okay great! thanks for replying!!!

All the best as you go ahead!!!
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top