Conditional formating with Message Box

Gregm66

Board Regular
Joined
Jan 23, 2016
Messages
170
Hi All,

I have set conditional formatting to cells on my worksheet that detect if the same value appears.
IE: If cell B6 value is "V10" and cell B14 value is "V10" then cell B14 color changes and text turns bold.

Formatting rule = "Format only cells that contain" - This is in cell B14
Cell B23 would be ( Cell Value. equal to. =($B$6:$B$14)
and so on down column B

what i am wanting to do is show a message box if the Value of cell B14 is the same as the cell value in B6.
this will continue down the Cells for that column if duplicate values are found.

Preferably done using VBA

I hope that my question is easy to understand.

Thanks in advance for any help.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
[h=2]Conditional formatting with Message Box[/h]This question has been solved please see below for my solution.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Range("B14").Value = Range("B6").Value Then
        MsgBox "Please Check Vehicle Allocation, Duplicate Allocation Detected"
    End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

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