|
- Sub 批处理() '这个是选择Excel文件
- Dim strFile, Wb As Workbook, i%, j%, Wjlx As String
- Dim Rng As Range
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Wjlx = "Excel文件,*.xls*"
- strFile = Application.GetOpenFilename(filefilter:=Wjlx, Title:="打开文件", MultiSelect:=True)
- If Not IsArray(strFile) Then GoTo 300
- For i = 1 To UBound(strFile)
- Set Wb = Workbooks.Open(strFile(i))
- For Each sht In Wb.Worksheets '遍历工作表
- sht.Activate
- sht.UsedRange.Value = sht.UsedRange.Value
- Next
- Wb.Close savechanges:=True '保存关闭工作簿
- Next
- MsgBox "完成"
- 300
- Application.ScreenUpdating = True
- Application.DisplayAlerts = True
- End Sub
复制代码 |
|