Sign up for our Excel webinar, times added weekly: https://www.excelcampus.com/blueprint-registration/
Learn how to make a Yes No Message Box (pop-up window) appear before the macro code runs. This is critical if you have custom macro buttons on the ribbon or anywhere in your workbook.
If the user accidentally presses a macro button then the code will run and could potentially ruin the workbook or cause irreversible damage.
The Yes No Message Box is easy to implement in any macro and only requires four lines of code.
Read the article and download the Excel file here:
http://www.excelcampus.com/vba/personal-macro-workbook-video-series/
In this video I explain exactly how to create this code and how to use the msgbox function in VBA.
The msgbox function is basically a line of code that creates a pop-up window with buttons on it. This means you do NOT need to create a userform. The function has parameters that allow you to choose what the buttons will say. It could be Yes/No, Ok/Cancel, Ok Only, Warning icon, or many other options. This is a great VBA skill to learn and add to any macro.
Other videos in this series:
How to Create a Personal Macro Workbook in Excel and Why You Need It (Part 1 of 4):
https://www.youtube.com/watch?v=rD2-mSbTuL0
Where Is The Personal Macro Workbook Stored and How to View It (Part 2 of 4):
https://www.youtube.com/watch?v=6cynP3OkIT0
How to Add Macro Buttons to the Excel Ribbon or Quick Access Toolbar (Part 3 of 4):
https://www.youtube.com/watch?v=dmdolFcS-fI
Please leave a comment below with any questions, and don't forget to hit the LIKE button if you enjoyed this video. Thank you!!!
00:00 Introduction
00:21 What is a Yes No Message Box
01:21 VBA Editor
01:48 Macro Code
02:20 Message Box Variable
04:48 If Statement
06:50 Running the Macro
08:40 Conclusion