Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cancel (Dismiss) Input Box | Excel Programming | |||
msgbox | Excel Programming | |||
dismiss blanks in lookup | Excel Worksheet Functions | |||
Dismiss a dialog box (Via a Macro) | Excel Programming | |||
Preventing Form Dialog dismiss (Red X) | Excel Programming |