|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
'这段语句的作用是在当前文件夹模糊找到文件名匹配的,把找到匹配的文件薄的内容复制到当前文件薄
Sub test()
Dim Wb As Workbook
Dim Temp As String
Application.ScreenUpdating = False
Name = Dir(ThisWorkbook.Path & "\*.xls")
While Name <> ""
If Name Like "*" & "情况" & "*" Then
Temp = ThisWorkbook.Path & Name
Set Wb = GetObject(Temp)
Wb.Sheets("报送报阅").Range("A1:f100").CurrentRegion.Copy Sheets("报送报阅").Range("A1:f100")
Wb.Close False
Set Wb = Nothing
End If
Wend
Application.ScreenUpdating = True
End Sub
|
|