|
▼まりな さん:
>1.Sheet1のA1〜E20の100個のセルにデータが表示されている。
こんどは 検索セル範囲が「表」なわけですね
Sub Try3()
Dim c As Range
Dim i As Long, n As Long
Dim s, v
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
For Each c In Worksheets("Sheet1").[A1:E20]
If Not IsEmpty(c.Value) Then dic(c.Value) = Empty
Next
With Worksheets("Sheet2").Range("V:V")
With Excel.Range(.Item(1), .Item(.Count).End(xlUp))
v = .Value
ReDim dup(1 To UBound(v), 0)
For i = 1 To UBound(v)
If Not IsEmpty(v(i, 1)) Then
If dic.Exists(v(i, 1)) Then
dup(i, 0) = "重複"
End If
End If
Next
.Offset(, 10).Value = dup
End With
End With
Set dic = Nothing
End Sub
|
|