Forced Save

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
 
O

Orlando Magalhães Filho

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top