Conditional Format With Message

ayazgreat

Well-known Member
Joined
Jan 19, 2008
Messages
1,151
Hi

I am using following formula for duplicated numbers from range A3 to A15000(=Countif($A$3:$A$15000,A3)>1)

I want with this conditional format that when any number is duplicated it gives me a message the following number is duplicated and take me above of first duplicated number.

Thanks in advance
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Thanks Sir for your Reply

So what would be the other way to do it if not to be done by condional format? Sir what do you suggest for it ? One thing I must figure out that i do not wish to prevent duplication I just want only intimation for duplication and take the first duplicated number asking that if I wish to go the same.
 
Upvote 0
You can use Data Validation to show a message when a duplicate value is entered. Conditional formatting could be set to highlight those duplicates, but moving to the cell with the duplicated values or changing the alert message depending on the duplicate, requires VB.

Setting A3 with

The Validation formula =(1=COUNTIF($A$3:$A$15000,A3)), error message type Information

and conditional formatting to =(1 < COUNTIF($A$3:$A$15000,A3)) will do that.
 
Upvote 0
Putting this in the sheet's code module will alert the user whenever a duplicate entry is made in A3:A15000. The Active Cell will be changed from the new entry location to the location of the duplicated entry.
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    Dim hereCell As Range
    Set hereCell = ActiveCell
    With Range("A3:A15000")
        If Not (Application.Intersect(Target, .Cells) Is Nothing) And Target.Cells.Count = 1 Then
        
            .Find(What:=Target.Value, After:=Target, LookIn:=xlValues, LookAt:=xlWhole, _
                SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
            
            If Target.Address <> ActiveCell.Address Then
                MsgBox Target.Value & " is duplicated in cells " & ActiveCell.Address & " & " & Target.Address
            Else
                hereCell.Select
            End If
            
        End If
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,422
Messages
6,119,395
Members
448,891
Latest member
tpierce

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