Hi there,
I have a code that I am using to prevent a user from saving an excel file until all required fields have been populated. The code works, but it works too well... I can't figure out how I CAN save the file so it can be used by others. Any thoughts? I need to save it in it's blank state to serve as a form. Thanks!
Code is pasted within "This Workook" in vba editor
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With WorksheetFunction
If Worksheets("test").Range("A1").Value = "0" Then
MsgBox "Cannot SAVE until ALL REQUIRED fields have been populated"
Cancel = True
End If
End With
End Sub
Bookmarks