how to find the mutiple files at single time?

October 23, 2015 at 02:59:32
Specs: Windows 7
I have some files name in excel sheet. I want to find that all files at one time. is it possible to find at same time? if you know the answer let me know immediately.

See More: how to find the mutiple files at single time?

Report •

#1
October 23, 2015 at 03:04:58
I dont understand what you want to do..

You have file names in an excel worksheet, do these file names contain the full path or the files you want to find, for example

C:\FileName.txt


Where are the files located?

What do you want to do after you have searched and found the files? do you want to return the file name into the excel worksheet?

Need a lot more detail, also we wont let you know immediately, we will do what we can when we can.


Report •

#2
October 23, 2015 at 03:18:07
Hello,

I have some file names in excel sheet like FT123, AT456, PT789. I have files on my C:/
Newfolder. just I find that all file names to this "Newfolder" folder in using single time.


Report •

#3
October 23, 2015 at 03:54:28
Still not 100% sure what you are after, however i am assuming you want to return the names of files within a folder. You can use the below VBA code within your Excel file. When you run it, it will ask you to navigate to the folder you wish to search, it will then return in column B all the filename of the files within that folder.

Let us know if this helps or if you need anything further

Private Sub Command0_Click()
    Dim RootFolder
    RootFolder = BrowseForFolder
    
    Dim MyObj As Object, MySource As Object, file As Variant
    
    file = Dir(RootFolder & "\")
    
    While (file <> "")
       ' Debug.Print Right(file, 4)
        
        x = ActiveSheet.Range("B" & Rows.Count).End(xlUp).Row
        ActiveSheet.Range("B" & x + 1).Value = file
        
        file = Dir()
    Wend
      
End Sub

Function BrowseForFolder(Optional OpenAt As Variant) As Variant
     'Function purpose:  To Browser for a user selected folder.
     'If the "OpenAt" path is provided, open the browser at that directory
     'NOTE:  If invalid, it will open at the Desktop level

    Dim ShellApp As Object

     'Create a file browser window at the default folder
    Set ShellApp = CreateObject("Shell.Application"). _
    BrowseForFolder(0, "Please choose a folder", 0, OpenAt)

     'Set the folder to that selected.  (On error in case cancelled)
    On Error Resume Next
    BrowseForFolder = ShellApp.self.Path
    On Error GoTo 0

     'Destroy the Shell Application
    Set ShellApp = Nothing

     'Check for invalid or non-entries and send to the Invalid error
     'handler if found
     'Valid selections can begin L: (where L is a letter) or
     '\\ (as in \\servername\sharename.  All others are invalid
    Select Case Mid(BrowseForFolder, 2, 1)
    Case Is = ":"
        If Left(BrowseForFolder, 1) = ":" Then GoTo Invalid
    Case Is = "\"
        If Not Left(BrowseForFolder, 1) = "\" Then GoTo Invalid
    Case Else
        GoTo Invalid
    End Select

    Exit Function

Invalid:
     'If it was determined that the selection was invalid, set to False
    BrowseForFolder = False
End Function


Report •

Related Solutions

#4
October 23, 2015 at 06:13:00
hello,

In Word file I have,

FT501A
IP501A
TE510A
FT511A
IP511A
PT521A
PT522A
PT523A
FT539A
IP540A
PT542A
IP545A
AT545A
AT547A
AT549A.


But I need to change

FT501A IP501A TE510A FT511A IP511A PT521A PT522A PT523A FT539A IP540A 542A IP545A AT545A AT547A AT549A


this type . here I have manually changed please tell me how to change using tool bcoz this is sample only I have lot names to be modified.


Report •

#5
October 23, 2015 at 07:00:04
First you say you are using Excel now you are using word?

Is this a new requirement?
Has the first issue been resolved?

If you need help you need to provide as much details as possible and keep consistant otherwise there is a lot of room for confusion.

Now the only thing i can see from your last exmsple is that the data is no longer in a column, is this what you have changed?

Please answer all questions above


Report •

#6
October 23, 2015 at 18:20:55
You have many file names in an excel sheet.
You put them into word to show how you want it to look.
Like, names in one long string separated by spaces.
And you want to use excel to do this.
Is that correct?

What is the end goal of this by the way?


Report •

Ask Question