Message Box when click a button - help please

jedibrown

Board Regular
Joined
Oct 17, 2011
Messages
136
Good afternoon,

I was wondering how I would go about adding a "warning" or "message" box when somebody clicks my command button within my workbook please?

I basically want to give intructions in the box once the button is clicked then possibly a yes/no button for would you like to continue? If yes then the button runs, if no then it doesn't.

Any help would be gratefully received.

Thanks

x
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Good afternoon,

I was wondering how I would go about adding a "warning" or "message" box when somebody clicks my command button within my workbook please?

I basically want to give intructions in the box once the button is clicked then possibly a yes/no button for would you like to continue? If yes then the button runs, if no then it doesn't.

Any help would be gratefully received.

Thanks

x

Dim Answer As String
Dim MyNote As String

Windows("blablabla.xls").Activate
Sheets("Sheet1").Select

MyNote = "Completed" & vbCrLf & "Send Emails Now?"

Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "blabla")
If Answer = vbNo Then

Sheets("Sheet1").Select

ElseIf Answer = vbYes Then

Call somecode


End If
End Sub
 
Upvote 0
Thanks for this - I ended up doing it the old fashioned way by adding a userform but you help is appreciated.

Thanks again
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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