|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub tianbiao()
Application.ScreenUpdating = False
Dim sh As Worksheet
Dim arr()
ReDim arr(1 To Sheets.Count, 1 To 2)
For Each sh In Sheets
n = n + 1
arr(n, 1) = sh.Name
arr(n, 2) = sh.[d2] / 2
Next sh
f = Dir(ThisWorkbook.Path & "\填.xls*")
If f = "" Then MsgBox "找不到填文件!": End
Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & f, 0)
For i = 1 To n
mc = arr(i, 1)
wb.Worksheets(mc).[b2].Resize(4, 1) = arr(i, 2)
Next i
wb.Close True
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub |
|