Hi
I have some code thatchecks on certain inputs and if the data input is either the same or the 1st 5 chars are the same what i would like is to have 2 or more messages boxes if the user enters the same data.
Here is where i am at the moment - with some help from you guys.
RTS checks on the 1st 5 chars and if there is a duplicate then to display the 1st message box.
RTS1 checks on the last char of the input to see if it is duplicated
Dups checks on the whole of the input( all chars entered.
[vba]
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Dups As Long
Dim RTS As Long
'Dim RTS1 As Long
If Not Block Then
If Target.Areas.Count > 1 Then Exit Sub
With Me.Range("B30:B45")
RTS = Evaluate("SumProduct(--(Left(B30:B45,5)=Left(" & Target(1, 1).Address & ",5)))")
'RTS1 = Evaluate("SumProduct(--(Mid(B30:B45,6,1)=Mid(" & Target(1, 1).Address & ",6,1)))")
Dups = Application.WorksheetFunction.CountIf(Me.Range("B30:B45"), Target(1, 1).Value)
If Dups > 1 Or RTS > 1 Then
If MsgBox("RTS Code Or Process Duplicated Please Check Process No ! _
Are You Really Sure You Want To Accept The Duplicate ?", vbYesNo) = vbYes Then
ActiveCell.Offset(1, 0).Select
End If
End If
End With
End If
End Sub
[/vba]