Popup Message box on multiple criteria and Popup message on conditional formatting done

Rahulkr

Board Regular
Joined
Dec 10, 2019
Messages
66
Office Version
  1. 2010
Platform
  1. Windows
Dear All,

Please help to achieve the goal as desired.

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Cancel = False
s = "Want to Continue?"

If Range("Q2") > 0 Then
MsgBox "Please fill !OUT OF OFFICE or IN LEAVE! ", vbOKOnly, ""
End If
If Range("Q6") = Range("Q9") And Range("Q7") = Range("Q10") Then
MsgBox "!No of staff coming is matched with number of picked and dropped staff!  Press Ok to continue"
Else
MsgBox "!Check no of staff coming with Picked Staff!", vbOKOnly, ""
End If
If Range("C6:E21,I6:K25").Interior.Color = RGB(255, 0, 0) Then
MsgBox "!Please Check Duplicate Entries!"
End If
If Range("O15") = 0 Then
MsgBox "!!Press Ok to continue and print!!", vbOKCancel, ""
If MsgBox(s, vbYesNo) = vbNo Then Exit Sub
bTemp = Application.Dialogs(xlDialogPrint).Show
End If

End Sub
Please help me to get popup message on the basis of following conditions.
1. Already conditional formatting is done in the following ranges(=$C$6:$C$21,$I$6:$I$25 and =$E$6:$E$21,$K$6:$K$25) to fill with red color if duplicate values found. I want to through the message if duplicate values found or if cell color is red, which I already achieved by conditional formatting.
2. message box on all conditions.
3. unless all criteria were not full filled then it won't show the Dialog box for printing.

for better understanding please find the image.

Please help me on this .....
1578400875318.png
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,224,829
Messages
6,181,218
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top