Just wanted to update. Here is the fixed code. Thank you for your help. You mentioned about having the End If before Next. That fixed it along with adding ws. before Cells(x, x)
[CODE = vba]
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(10, 2) = "" Then
MsgBox "ADDRESS Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(10, 2)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(11, 2) = "" Then
MsgBox "CITY Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(11, 2)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(11, 5) = "" Then
MsgBox "ZIP CODE Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(11, 5)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(5, 9) = "" Then
MsgBox "DATE Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(5, 9)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(9, 9) = "" Then
MsgBox "JOB NUMBER Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(9, 9)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(10, 9) = "" Then
MsgBox "YOUR NAME(INSPECTED BY) Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(10, 9)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(11, 13) = "" Then
MsgBox "YOUR CERT NUMBER Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(11, 13)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(11, 9) = "" Then
MsgBox "TEST TYPE Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(11, 9)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(12, 9) = "" Then
MsgBox "CERTIFICATION EXPIRATION Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(12, 9)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(12, 12) = "" Then
MsgBox "GAUGE SERIAL NUMBER Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(12, 12)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(13, 11) = "" Then
MsgBox "GAUGE RECALIBRATION DATE Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(13, 11)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(16, 1) = "" Then
MsgBox "SERVICE CALL QUANTITY Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(16, 1)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(16, 11) = "" Then
MsgBox "SERVICE CALL $ AMOUNT Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(16, 11)
End If
If Worksheets("Service Receipt").Cells(17, 1) > "0" And Worksheets("Service Receipt").Cells(17, 11) = "" Then
MsgBox "BACKFLOW $ AMOUNT Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(17, 11)
End If
If Worksheets("Service Receipt").Cells(9, 2) > "" And Worksheets("Service Receipt").Cells(53, 1) = "" Then
MsgBox "NOTES TO OFFICE Missing on Service Receipt", vbInformation, "Dignity Fire Protection"
Cancel = True
Application.Goto Worksheets("Service Receipt").Cells(53, 1)
End If
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Name Like "*BF*" Then
If ws.Cells(17, 5) = "Reduced Pressure" And ws.Cells(29, 5) = "" Then
MsgBox "CHECK #1 missing value on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(29, 5)
End If
If ws.Cells(17, 5) = "Reduced Pressure" And ws.Cells(31, 5) = "" Then
MsgBox "CHECK #2 missing value on (ws.Name)", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(31, 5)
End If
If ws.Cells(17, 5) = "Reduced Pressure" And ws.Cells(33, 5) = "" Then
MsgBox "RELIEF VALVE missing value ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(33, 5)
End If
If ws.Cells(17, 5) = "Double Check" And ws.Cells(29, 5) = "" Then
MsgBox "CHECK #1 missing value ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(29, 5)
End If
If ws.Cells(17, 5) = "Double Check" And ws.Cells(31, 5) = "" Then
MsgBox "CHECK #2 missing value ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(31, 5)
End If
If ws.Cells(17, 5) = "Pressure Vacuum Breaker" And ws.Cells(29, 5) = "" Then
MsgBox "CHECK #1 missing value on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(29, 5)
End If
If ws.Cells(17, 5) = "Pressure Vacuum Breaker" And ws.Cells(37, 5) = "" Then
MsgBox "AIR INLET missing value on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(37, 5)
End If
If ws.Cells(17, 5).Value > "" And ws.Cells(39, 6) = "" Then
MsgBox "SHUT OFF VAVLE #1 missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(39, 6)
End If
If ws.Cells(17, 5).Value > "" And ws.Cells(39, 14) = "" Then
MsgBox "SHUT OFF VAVLE #2 missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(39, 14)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(19, 5) = "" Then
MsgBox "ASSEMBLY TEST FOR missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(19, 5)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(21, 5) = "" Then
MsgBox "MANUFACTURER missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(21, 5)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(22, 5) = "" Then
MsgBox "SIZE FOR missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(22, 5)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(23, 5) = "" Then
MsgBox "LOCATION missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(23, 5)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(17, 12) = "" Then
MsgBox "ASSEMBLY FOR missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(17, 12)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(19, 12) = "" Then
MsgBox "ASSEMBLY USE missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(19, 12)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(21, 12) = "" Then
MsgBox "MODEL NUMBER missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(21, 12)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(22, 12) = "" Then
MsgBox "SERIAL NUMBER missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(22, 12)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(23, 12) = "" Then
MsgBox "LINE PRESSURE missing info on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(23, 12)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(45, 11) = "" Then
MsgBox "QUESTION #1 missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(45, 11)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(46, 11) = "" Then
MsgBox "QUESTION #2 missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(46, 11)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(47, 11) = "" Then
MsgBox "QUESTION #3 missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(47, 11)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(48, 11) = "" Then
MsgBox "QUESTION #4 missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(48, 11)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(49, 11) = "" Then
MsgBox "QUESTION #5 missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(49, 11)
End If
If ws.Cells(29, 5).Value > "" And ws.Cells(50, 11) = "" Then
MsgBox "BACKFLOW PASS/FAIL missing on ws.Name", vbExclamation, "Dignity Fire Protection"
Cancel = True
Application.Goto ws.Cells(50, 11)
End If
End If
Next ws
End Sub
[CODE/]