I have this macro which checks for blanks from A cell to I. If the cells are blank the user isn't able to save. But the problem is that if I dont enter anything in the A cell then save is enabled.
Here's my VBA code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim rsave As Range, N As Long
Dim cell As Range
With Sheet2
N = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To N
Set rsave = Range("A" & i & ":I" & i)
For Each cell In rsave
If cell = "" Then
Dim missdata
missdata = MsgBox("missing data", vbOKOnly, "Missing Data")
Cancel = True
cell.Select
Exit Sub
End If
Next cell
Next i
End With
End Sub