Cancel OptionButton Click on vbNo or vbYes

natekris8183

Board Regular
Joined
Mar 12, 2013
Messages
156
I have looked around and I understand how to either use Case Select or If to justify whether or not to proceed. The problem I have is I have a set of OptionButtons on a Userform. It defaults on Activate to what is the standard delivery day for that particular location. However, due to holidays, it can fluctuate so I wanted to leave the option to change the delivery day, but it is an EXCEPTION. So I want to prompt the radio button, when clicked, that if it's not the standard day (justified by the vlookup of the day associated in a table for that location), that is activates a Yes/No msgbox with "Change delivery day?". The solution will be that if you select "No" (iAns = vbNo) then it cancels he action of selecting the OptionButton. I would want the standard one to stay selected. Now I know I can put a loop with For Each for the vbNo response to go back and reselect the appropriate button, but to have it toggle back-and-forth seems rather extensive. I am assuming there has to be some syntax to just cancel the action of OptionButton_Click.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,827
Messages
6,121,809
Members
449,048
Latest member
greyangel23

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