按名称搜索文件夹中的多个文件,然后将其复制到其他文件夹

时间:2018-10-12 11:27:46

标签: file search

我有300多个文件名。 我需要按名称查找该文件并移至其他位置

我尝试用文件名之间的OR进行搜索,但从所有列表中仅出现7个文件

有什么想法可以快速做到吗?

我找不到与此相关的任何宏命令

谢谢

2 个答案:

答案 0 :(得分:0)

[main] ERROR o.evosuite.runtime.agent.AgentLoader - Exception class 
java.lang.RuntimeException: AttachProvider.providers() failed to return any 
provider. Tool classloader: java.net.FactoryURLClassLoader@2ef9b8bc
java.lang.RuntimeException: AttachProvider.providers() failed to return any 
provider. Tool classloader: java.net.FactoryURLClassLoader@2ef9b8bc

可能就是您想要的。

答案 1 :(得分:0)

我发现了这个 并且正在工作

 Sub copyfiles()
'Updateby Extendoffice
    Dim xRg As Range, xCell As Range
    Dim xSFileDlg As FileDialog, xDFileDlg As FileDialog
    Dim xSPathStr As Variant, xDPathStr As Variant
    Dim xVal As String
    On Error Resume Next
    Set xRg = Application.InputBox("Please select the file names:", "KuTools For Excel", ActiveWindow.RangeSelection.Address, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xSFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
    xSFileDlg.Title = "Please select the original folder:"
    If xSFileDlg.Show <> -1 Then Exit Sub
    xSPathStr = xSFileDlg.SelectedItems.Item(1) & "\"
    Set xDFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
    xDFileDlg.Title = "Please select the destination folder:"
    If xDFileDlg.Show <> -1 Then Exit Sub
    xDPathStr = xDFileDlg.SelectedItems.Item(1) & "\"
    For Each xCell In xRg
        xVal = xCell.Value
        If TypeName(xVal) = "String" And xVal <> "" Then
            FileCopy xSPathStr & xVal, xDPathStr & xVal
        End If
    Next
End Sub