Restrict SAVE option: based on formula result

scoobyblue

Active Member
Joined
Jun 30, 2004
Messages
380
Is this possible? I want to restrict users from saving an Excel file, unless certain criteria (ideally within a formula) is met. Hope you can help, many thanks Stewart of Aylesbury. :rolleyes:
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello,

There was a similar question to this recently, the answer I gave then was as follows:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 
If Range("a1").Value = "" Then 
    Cancel = True 
End If 
End Sub

This needs to go into the THIS WORKBOK Code window.

Change the If ... to your formula/cell value.
 
Upvote 0
Thanks onlyadrafter - I've also added a message box to confirm why the file is not being saved. Thanks again, Stewart.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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