Related:
- File names list
- My contacts list names - Guide
- Windows 10 iso file download 64-bit - Download - Windows
- Dvi file - Guide
- Counter strike 1.6 cheats list - Guide
- Messenger file downloader - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
December 27, 2022
555
Sep 29, 2011 at 08:55 AM
Sep 29, 2011 at 08:55 AM
Hi Aslam,
What do you mean by "preparing the list of file names"?
Best regards,
Trowa
What do you mean by "preparing the list of file names"?
Best regards,
Trowa
Sep 29, 2011 at 04:39 PM
Thank you for your reply.
I mean by " Preparing the List of file names" that when search command find the word which I am searching, the macro copy just the file name containing that word and past it in a Excel sheet.
e.g. I am searching a word "Mango" so, the macro search it in all files of specified folder and copy the name of each file containing this word and past them in a worksheet step by step.
Oct 4, 2011 at 09:55 AM
Try this code:
Sub FindWordDisplayFiles() Dim lCount As Long Dim wbResults As Workbook Dim wbCodeBook As Workbook Dim sWhat As String Dim r As Range Dim x As Integer Application.ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False sWhat = InputBox("Find what?") On Error Resume Next Set wbCodeBook = ThisWorkbook With Application.FileSearch .NewSearch 'Change path to suit .LookIn = "C:\MyDocuments\TestResults" .FileType = msoFileTypeExcelWorkbooks If .Execute > 0 Then For lCount = 1 To .FoundFiles.Count Set wbResults = Workbooks.Open(Filename:=.FoundFiles(lCount), UpdateLinks:=0) Set r = Cells.Find(What:=sWhat, LookAt:=xlPart) If Not r Is Nothing Then 'Change destiantion file to suit and make sure it's not in same folder as path above Workbooks("Destination.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = ActiveWorkbook.FullName End If wbResults.Close SaveChanges:=False Next lCount End If End With On Error GoTo 0 Application.ScreenUpdating = True Application.DisplayAlerts = True Application.EnableEvents = True End SubBest regards,
Trowa
Oct 5, 2011 at 06:39 AM
I really appreciate your efforts!!!!!!!!!!!!!
I am sorry I think I have not informed you that the folder contains files of Ms Word not of Ms Excel. the search command have to search in Ms Words files.
Therefore kindly alter it and enable it to find the word in MS Word files.
Furthermore, please add a message which confirm that the work has completed.
Thank you once again for your help
Aslam
Oct 6, 2011 at 09:25 AM
Let me ask someone with more knowledge to see if he can solve your query.
Best regards,
Trowa
Oct 6, 2011 at 07:42 PM
Aslam, I have not heard of this software. If http://www.ghisler.com/efaqfile.htm#printlist link is related to this software, it seems that you can copy the file names to some external file etc. Could you see the link and see if that works out. If the names of the files can be some how copied out into a one file, then managing that one file would be simple (I think)