help with input box - yes/no

avishain

Board Regular
Joined
Dec 14, 2010
Messages
75
hello there,

i got some useres who work with excel 2007.

i created a macro that save a file to a spesific folder and i need help with the followin:

i want a macro that once the user hits on it - it will pop up a msg/input box and will as the user :

"are you sure you want to save the file"?

i want that the user will choose between 2 options:

"yes" - the macro will proceed to the macro that i created
"cancel" -the macro will exit.

by the way,i do i create these 2 buttons? ( i dont want that the user will have to type the answer-i want him to click with the mouse )
thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try like this

Code:
If MsgBox("Are you sure that you want to save", vbYesNo + vbQuestion) = vbNo Then Exit Sub
'
'rest of your macro
 
Upvote 0
Would you also be happy with 3 buttons: Yes / No / Cancel?
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

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