Cannot Dismiss the MsgBox
Hi Ron,
You need to assign the response to a variable and then test the variable for
the user's response. You can use If/Then/Else or Select Case for the testing.
Sub testfollowup()
Dim c As Range
Dim userResponse As Variant
For Each c In ActiveSheet.Range("K12:AI10000")
If c.Font.ColorIndex = 3 Then
userResponse = MsgBox("Please make additional corrections", _
vbExclamation + vbOKCancel, "TEST")
Select Case userResponse
Case vbCancel
Exit Sub 'Or other required code
Case vbOK
'Required code here
End Select
Else
userResponse = MsgBox("Data validated, good job!" _
& vbNewLine & _
"If the sheet is to be printed, " & _
"clicking on the Print Setup button " & _
"prepares the file for printing.", _
vbExclamation + vbOKCancel, "TEST")
Select Case userResponse
Case vbCancel
Exit Sub 'Or other required code
Case vbOK
'Required code here
End Select
End If
Next c
End Sub
--
Regards,
OssieMac
|