Option
Explicit
Sub
ChkIt()
Dim
dict
As
Dictionary
Dim
oWs
As
Excel.Worksheet
Dim
rngChk
As
Range, rngNew
As
Range
Dim
arrChk
As
Variant
, arrNew
As
Variant
Dim
x
As
Long
, y
As
Long
Dim
sKey
As
String
Set
dict =
New
Dictionary
dict.CompareMode = TextCompare
Set
oWs = ThisWorkbook.ActiveSheet
With
oWs
Set
rngChk = .Range(
"A3"
).CurrentRegion
Set
rngChk = rngChk.Offset(1, 0).Resize(rngChk.Rows.Count - 1, rngChk.Columns.Count)
Set
rngChk = Range(rngChk.Columns(2), rngChk.Columns(8))
Set
rngNew = rngChk.Rows(rngChk.Rows.Count)
Set
rngChk = rngChk.Resize(rngChk.Rows.Count - 1, rngChk.Columns.Count)
arrChk = rngChk: arrNew = rngNew
sKey =
""
For
y = LBound(arrNew, 2)
To
UBound(arrNew, 2)
sKey = sKey & arrNew(1, y)
Next
y
dict.Add Key:=sKey, Item:=0
For
x = UBound(arrChk, 1)
To
LBound(arrChk, 1)
Step
-1
sKey =
""
For
y = LBound(arrNew, 2)
To
UBound(arrNew, 2)
sKey = sKey & arrChk(x, y)
Next
y
If
dict.Exists(sKey)
Then
_
Call
MsgBox(
"in Zeile "
& Format(x + 3,
"#0"
), vbExclamation,
"Doppelter Eintrag"
)
Next
x
End
With
Set
oWs =
Nothing
Set
dict =
Nothing
End
Sub