|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub test()
Dim ar(), br, i&, r&, wks As Worksheet
With [A1].CurrentRegion
.Offset(1, 1).ClearContents
br = .Value
End With
For Each wks In Sheets
If wks.Name <> "汇总" Then
r = r + 1
ReDim Preserve ar(1 To r)
With wks.[A1].CurrentRegion
ar(r) = Intersect(.Offset(), .Offset(1))
End With
For i = 1 To UBound(ar(r))
ar(r)(i, 1) = Format(ar(r)(i, 1) & "-" & ar(r)(i, 2) & "-" & ar(r)(i, 3), "yyyy年m月d日") _
& ar(r)(i, 4)
ar(r)(i, 2) = ar(r)(i, 5)
Next i
For i = 2 To UBound(br)
If InStr(br(i, 1), wks.Name) Then
Cells(i, 2).Resize(UBound(ar(r)), 2) = ar(r)
Exit For
End If
Next i
End If
Next
Beep
End Sub
|
评分
-
1
查看全部评分
-
|