Hi all,

I have a workbook that I run each day for a simple data process. One page in the workbook ("Integrity") contains a series of 2 checks on different conditions within the data. Ideally, if one of these checks is breached/tripped, I would like the user to know about it, so he/she can go and check the data and make sure that the exception is okay.

My code is below. Potentially, there are 2 checks that can be tripped. If none of them are tripped, the fields in the workbook will simply read "OK". If the condition is breached, then the respective field will display "CHECK". If a field displays "CHECK" I want the user to see a message box that will describe the problem and ask if he/she wishes to continue. If they click "No", the macro will terminate. Then they can go and look at the data and see if there's a problem. If they click "Yes", then I would like for the routine to continue running. If neither check is tripped, or the user clicks "yes" to continue past one or more MsgBoxes, then the routine should keep running.

Does anyone know how to nest these If, Then statements - combined with MsgBoxes that have a yes or no output? In summary, if field C4 or C5 contains "CHECK", then a message box should pop up. If the box pops up, it should give an option to continue the macro or quit the macro. If neither C4 nor C5 contains "CHECK", then no box should be displayed and the macro should just run through.

Any and all help is appreciated as I've tried several things and had no luck.

Thanks!

Sub RunProcess()



Dim OutPut1 As Integer
Dim OutPut2 As Integer




If Sheets(Sheet5.Name).Range("C4").Value = "CHECK" Then
OutPut1 = MsgBox("Please check that all data is present. Do you want to continue?", vbQuestion + vbYesNo, "Integrity Breach: Data Count")
    If OutPut1 = 7 Then
    Exit Sub

    Else

If Sheets(Sheet5.Name).Range("C6").Value = "CHECK" Then
OutPut2 = MsgBox("Price integrity breach detected - ensure all underlying fields have prices. Do you want to continue?", vbQuestion + vbYesNo, "Integrity Breach: Price Count")
If OutPut2 = 7 Then
Exit Sub
        
        
Else

Call DailyRoutine


End If
End If
End If
End If




End Sub