Hi,
I have written the before save VBA which prevents someone from saving the workbook when certain cells are left blank.
I want to use this as a template and to save the workbook with the cells blank however, when any other user opens and tries to save, I want my message to appear and them to be unable to save. How do I amend my VBA to allow me to save as the editor ONLY?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If WorksheetFunction.CountA(Worksheets("Sheet1").Range("E1,D7,C5,D11,X4,D15")) < 6 Then
MsgBox "Workbook will not be saved unless" & vbCrLf & _
"all required fields have been filled in!"
Cancel = True
End If
End Sub
Is anyone able to assit?
Many thanks,
Hannah
I have written the before save VBA which prevents someone from saving the workbook when certain cells are left blank.
I want to use this as a template and to save the workbook with the cells blank however, when any other user opens and tries to save, I want my message to appear and them to be unable to save. How do I amend my VBA to allow me to save as the editor ONLY?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If WorksheetFunction.CountA(Worksheets("Sheet1").Range("E1,D7,C5,D11,X4,D15")) < 6 Then
MsgBox "Workbook will not be saved unless" & vbCrLf & _
"all required fields have been filled in!"
Cancel = True
End If
End Sub
Is anyone able to assit?
Many thanks,
Hannah