LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cancel (Dismiss) Input Box Ron[_6_] Excel Programming 1 April 16th 09 08:21 PM
msgbox ranswert Excel Programming 5 February 15th 08 09:43 PM
dismiss blanks in lookup Manuel Excel Worksheet Functions 5 July 30th 07 02:32 AM
Dismiss a dialog box (Via a Macro) msnews.microsoft.com[_9_] Excel Programming 3 October 28th 05 11:43 AM
Preventing Form Dialog dismiss (Red X) Jim Zeeb[_2_] Excel Programming 3 August 1st 05 01:16 AM


All times are GMT +1. The time now is 07:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"