|
大致是这个样子
- Sub sdaf()
- Dim xx, sr, wb As Workbook
- Dim s As Double
- Application.ScreenUpdating = False
- xx = Application.GetOpenFilename("excel文件,*.xlsx", , , , True)
- If Not VBA.TypeName(xx) = "Boolean" Then
- For Each sr In xx
- Set wb = Workbooks.Open(sr)
- s = s + wb.Sheets(1).Range("H8")
- wb.Close False
- Next
- End If
- ThisWorkbook.Sheets(1).Range("a1").Value = s
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|