Originally Posted by
mbarron
Here you go.
[vba]Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim iSht As Integer, lRow As Long, strOut As String, i As Long, shtCur As Worksheet
Dim closeIt
For iSht = 1 To Sheets.Count
Set shtCur = Sheets(iSht)
If UCase(shtCur.Name) <> "TEST" Then
lRow = shtCur.Cells(Rows.Count, 13).End(xlUp).Row
For i = 8 To lRow
If shtCur.Cells(i, 13) = 1 And shtCur.Cells(i, 2) = "" Then
strOut = strOut & shtCur.Name & " row number " & i & vbLf
End If
Next
End If
Next
If strOut <> "" Then
closeIt = MsgBox("The following are not complete" & vbLf & strOut _
& "Do you want to exit without entering the daat" & vbLf & _
"Click Yes to exit, click No to edit", vbYesNo)
If closeIt = vbYes Then
Cancel = False
Else
Cancel = True
End If
End If
End Sub[/vba]