|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Public Sub 杀杀杀()
Dim d As Object, i&, R, Rng()
Set d = CreateObject("scripting.dictionary")
R = Sheet1.Range("a2:a" & [a1048576].End(xlUp).Row)
ReDim Rng(1 To UBound(R), 1 To 1)
For i = 1 To UBound(R)
If Not d.exists(R(i, 1)) Then
d(R(i, 1)) = ""
Rng(i, 1) = 1
Else
Rng(i, 1) = 0
End If
Next
Sheet2.Activate
[a2:b1048576].Clear
Sheet1.Rows("1:1").Copy [a1]
[a2].Resize(UBound(R), 1) = R
[b2].Resize(UBound(R), 1) = Rng
Set d = Nothing
End Sub
|
|