Forced Save

  • Thread starter Thread starter Shaun Farris
  • Start date Start date
S

Shaun Farris

I have a spreadsheet that is used for a log of part numbers to be generated.
I am trying to find a way of preventing the save option from being available
unless the cells in the worksheet have been changed colour from black to
red.

Anyone have any ideas

Cheers
 
Hi Shaun Farris,

If you want to avoid saves when the cell color is different of black, try
this:
- Open your workbook
- Press Alt+F11 to open VBE Window
- Double click Thisworkbook object
- Insert the code below:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Range("A1").Interior.ColorIndex <> 3 Then
MsgBox "There isn't changes to save."
Cancel = True
End If
End Sub


HTH
 
Back
Top