|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub TEST1()
Dim ar, br, cr, i&, j&, r&, strReplace$
With [AA19].CurrentRegion
ar = .Value
ReDim Preserve ar(1 To UBound(ar), 1 To 7)
For i = 1 To UBound(ar)
ar(i, 1) = Replace(ar(i, 1), " ", "")
For j = 4 To UBound(ar, 2)
Set ar(i, j) = .Cells(i, j - 3)
Next j
ar(i, 2) = Split(ar(i, 1), ".")(0)
ar(i, 3) = Split(ar(i, 1), ".")(1)
Next i
End With
Rows("53:" & Rows.Count).Clear
With [AE52].CurrentRegion
br = .Value
For j = 1 To UBound(br, 2)
r = 15
strReplace = Replace(br(1, j), " ", "")
cr = Split(strReplace, ".")
For k = 1 To UBound(ar)
If ar(k, 3) = cr(0) Then
For i = 4 To UBound(ar, 2)
r = r + 1
ar(k, i).Copy .Cells(r, j)
Next i
End If
Next k
For k = 1 To UBound(ar)
If ar(k, 2) = cr(1) Then
For i = 4 To UBound(ar, 2)
r = r + 1
ar(k, i).Copy .Cells(r, j)
Next i
End If
Next k
Next j
End With
Beep
End Sub
|
评分
-
1
查看全部评分
-
|