|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub TEST2()
Dim ar, i&, r&, wks As Worksheet
Application.ScreenUpdating = False
ReDim ar(1 To Worksheets.Count, 1 To 3) As String
ar(1, 1) = "序号": ar(1, 2) = "发票号码": ar(1, 3) = "名称"
r = 1
With Worksheets("汇总")
For Each wks In Worksheets
If wks.Name <> .Name Then
r = r + 1
ar(r, 1) = Format(r, "00")
ar(r, 2) = wks.[B1].Value
ar(r, 3) = wks.[B3].Value
End If
Next
.[A1].CurrentRegion.Clear
.[A1].Resize(r, 3) = ar
.Activate
End With
Application.ScreenUpdating = True
Beep
End Sub
|
|