|
- Sub getdata()
- Dim FilePath$, FileName$, Str$, Arr, Sh As Worksheet
- Application.ScreenUpdating = False
- On Error Resume Next
- FilePath = ThisWorkbook.Path & "\人员"
- FileName = Dir(FilePath & "*.xls?")
- Do While Len(FileName)
- With GetObject(FilePath & FileName)
- Arr = .Sheets(1).UsedRange
- Str = Split(.Name, ".xls")(0)
- .Close 0
- End With
- If Sheets(Str) Is Nothing Then Sheets.Add.Name = Str
- Set Sh = Sheets(Str)
- Sh.UsedRange.ClearContents
- Sh.[a1].Resize(UBound(Arr), UBound(Arr, 2)) = Arr
- FileName = Dir
- Loop
- Application.ScreenUpdating = True
- End Sub
复制代码
新建文件夹.rar
(39.73 KB, 下载次数: 45)
|
评分
-
1
查看全部评分
-
|