Hi,
I am looking for a code that would prevent user from saving the file if count of no empty cells in column "E" is different than in columns "F"-"AE"
Any ideas?? I tried with below but failed
I am looking for a code that would prevent user from saving the file if count of no empty cells in column "E" is different than in columns "F"-"AE"
Any ideas?? I tried with below but failed
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Application.Sheets("Sheet1").Range("E2:E").Count <> Application.Sheets("Sheet1").Range("f2:f").Count then
Cancel = True
MsgBox "Save cancelled"
End If
End Sub