|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub t()'我想你是这个意思
Application.ScreenUpdating = False
Dim lr&, ar, br, cr(2, 3), a, b, d As Object, i%, c%, st$, ymd$
Set d = CreateObject("scripting.dictionary")
With Sheets("查看")
lr = .Cells(Rows.Count, 2).End(xlUp).Row
If lr > 2 Then
ar = .Range("b3:b" & lr)
For i = 1 To UBound(ar)
If Len(ar(i, 1)) Then: ymd = Trim(Split(ar(i, 1), ",")(0)): d(ymd) = ""
Next
End If
End With
a = Array(1, 27, 53)
b = Array(3, 4, 5, 6)
With Sheets("收盘数据")
For i = UBound(a) To 0 Step -1
ymd = Trim(.Cells(1, a(i)))
If Not d.exists(ymd) Then
ar = .Cells(1, a(i)).CurrentRegion
For c = 0 To UBound(b)
.Cells(1, a(i)).CurrentRegion.Offset(1).Sort .Cells(2, b(c) + i * 26), 2, Header:=1
br = Application.Transpose(.Cells(3, 2 + i * 26).Resize(10))
st = .Cells(1, 1 + i * 26) & "," & Join(br, ",")
cr(0, c) = st
Next
.Cells(1, a(i)).CurrentRegion = ar
Sheets("查看").Cells(Rows.Count, 2).End(xlUp).Offset(1).Resize(1, 4) = cr
End If
Next
End With
Set d = Nothing
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|