|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
帮我解释一下吧,这个我该怎么修改显示的列数和行数啊(现在显示在C和D列)
Sub yy()
Dim rng, d As Object, i&, c As Range, x As Date, y!
Set d = CreateObject("Scripting.Dictionary")
With Sheet1
rng = .Range(.[a3], .[d65536].End(3))
End With
For i = 1 To UBound(rng)
If Not d.exists(rng(i, 2)) Then
d(rng(i, 2)) = Array(rng(i, 1), rng(i, 4))
Else
x = Format(IIf(rng(i, 1) > d(rng(i, 2))(0), rng(i, 1), d(rng(i, 2))(0)), "yyyy/m/d")
y = d(rng(i, 2))(1) + rng(i, 4)
d(rng(i, 2)) = Array(x, y)
End If
Next i
With Sheet2
For Each c In .Range(.[a3], .[a65536].End(3))
c(1, 3).Resize(, 2) = d(c & "")
Next
End With
End Sub |
|