|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST6()
Dim ar, i&, dic As Object
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
ar = Sheets(1).[A1].CurrentRegion.Value
For i = 2 To UBound(ar)
dic(ar(i, 1)) = Array(ar(i, 1), ar(i, 2), Date - ar(i, 2))
Next i
With Sheets(2)
.[A1].CurrentRegion.Offset(1).Clear
With .[A2].Resize(dic.Count, 3)
.Value = Application.Rept(dic.items, 1)
.Columns(2).NumberFormatLocal = "yyyy/m/d"
End With
.Activate
End With
Set dic = Nothing
Application.ScreenUpdating = True
Beep
End Sub
|
|