|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub kaohisng_js()
- Application.ScreenUpdating = False
- Dim JS As Object
- Dim I#, K#
- Dim GHB(1 To 100000, 1 To 1)
- Set JS = CreateObject("ScriptControl")
- JS.Language = "JScript"
- s = "var aa={bb:'0' };"
- JS.addcode s
- With Sheet1
- For I = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
- s = "aa['" & .Cells(I, "A").Text & "']=" & I & ";"
- JS.addcode s
- Next
- For I = 2 To .Cells(Rows.Count, "D").End(xlUp).Row
- If Len(JS.eval("aa['" & .Cells(I, "D").Text & "']")) = 0 Then
- K = K + 1
- GHB(K, 1) = .Cells(I, "D").Text
- End If
- Next
- End With
- With Sheet2
- .Cells.Clear
- .[A1].Resize(K, 1) = GHB
- End With
- Application.ScreenUpdating = True
- MsgBox "JOB IS OKEY"
- End Sub
复制代码 |
|