No Save Until Complete - 1118 - Learn Excel from MrExcel

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Oct 8, 2009.
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.

This blog is the video podcast companion to the book, Learn Excel 97-2007 from MrExcel. Download a new two minute video every workday to learn one of the 377 tips from the book!
maxresdefault.jpg


Transcript of the video:
Hey, welcome back to the MrExcel netcast, I'm Bill Jelen.
Basically, you start out with massive amounts of data, and say “How we're going to analyze this?” Well, let's fire up a Pivot table and see if we can solve this problem!
Hey, welcome back to the MrExcel netcast, I'm Bill Jelen.
Today's question sent in by Roy from the UK.
Roy has a cell, he says “Look, I want to check this cell, if this cell isn't complete, I don't want to let them save the workbook.” OK, yeah, we can do that, come back here to the Developer tab, go to Visual Basic.
Now in the Project Explorer you want to go to this workbook, double-click and then left drop-down, choose Workbook, right drop-down, want to choose an event called BeforeSave.
Alright, and you’ll notice here that the BeforeSave gives us a variable called Cancel, alright.
So what we're going to do, we’re going to say If Not Worksheets( and then the worksheet is “Menu”).Range(“E3”) > let's say “ “, they have to put something there, more than a space.
Then Cancel = True, there you go, that'll do it, that will prevent them from saving.
Now, maybe we should tell them what's going on, Msgbox “Can not save until E3 is complete!” Alright, so we get rid of this little bit of code here, and come back to Excel.
Will do File, Save As, “Can not save until E3 is complete!” I just put something in there, and now File, Save As, and it works, there you go, check it out.
Alright Roy, thanks for sending that question in, and thanks to you for stopping by, we’ll see you next time for another netcast from MrExcel!
Well thanks for stopping by, we'll see you next time for another netcast from MrExcel!
 

Forum statistics

Threads
1,223,701
Messages
6,173,916
Members
452,538
Latest member
ralphtaylor466

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