Excel - Prevent Workbook Saving Until Form is Complete! | Excel Tutorial - Episode 1118

607 views · Published 8 October 2009 · 2:08 · Indexed 20 September 2026

Channel: MrExcel.com · 2009 · Education

Watch on YouTube

Microsoft Excel Tutorial:  Prevent Workbook Saving Until Form is Complete! 

Welcome back to the MrExcel netcast, where we tackle all your Excel questions and help you become an Excel pro. In today's episode, we have a question from Roy in the UK who wants to know how to prevent saving a workbook until a certain cell is complete. Well, Roy, I have the solution for you!

First, we need to go to the Developer tab and open up Visual Basic. Then, in the Project Explorer, we select the workbook and choose the BeforeSave event. This will give us a variable called Cancel, which we will use to prevent the workbook from being saved.

Next, we use an If statement to check if the cell in question, in this case, “Menu”!E3, is complete. If it is not, we set Cancel to True, which will prevent the workbook from being saved. And just to make sure the user knows why they can't save, we add a message box that says “Can not save until E3 is complete!”

Now, when the user tries to save the workbook without completing the cell, they will receive a message and the workbook will not be saved. Once they enter something in the cell, they can save the workbook as usual. It's a simple solution that can save you from potential errors and incomplete data.

Thank you, Roy, for sending in your question and thank you to all of you for tuning in. Don't forget to subscribe to our channel for more Excel tips and tricks. And if you have any Excel questions, leave them in the comments below and we might feature them in our next netcast. See you next time on MrExcel!

Buy Bill Jelen's latest Excel book: https://www.mrexcel.com/products/latest/

You can help my channel by clicking Like or commenting below: https://www.mrexcel.com/like-mrexcel-on-youtube/

Table of Contents:
(00:00) Introduction by Bill Jelen
(00:14) Today's question from Roy about preventing saving without complete cell
(00:25) Using Visual Basic to create a BeforeSave event
(01:05) Code to prevent saving without complete cell and display message
(01:28) Demonstration of code in action
(01:42) Clicking Like really helps the algorithm

#excel #microsoft #microsoftexcel #exceltutorial #exceltips #exceltricks #excelmvp #freeclass #freecourse #freeclasses #excelclasses #microsoftmvp #walkthrough #evergreen #spreadsheetskills #analytics #analysis #dataanalysis #dataanalytics #mrexcel #spreadsheets #spreadsheet #excelhelp #accounting #tutorial 

This video answers these common search terms:
Analyzing data with Pivot tables
BeforeSave event
Checking if a cell is complete
Completing cell E3 in Excel
Excel netcast from MrExcel
Excel tips and tricks
Message box in Excel VBA
Preventing workbook save
Saving a workbook in Excel
Visual Basic in Excel
Workbook save restriction

Join the MrExcel Message Board discussion about this video at https://www.mrexcel.com/board/threads/1152674/



Roy asks how to prevent a workbook from being saved until the workbook is complete. Episode 1118 will show you the four lines of VBA needed to make this happen.

More from this channel