+ Reply to Thread
Results 1 to 2 of 2

Search Text Excel All files & Subfolders

  1. #1
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Post Search Text Excel All files & Subfolders

    I would like run a vba script that will search for a text lets say "ACDC" under the following path "C:\Music" including all subfolders for excel files ending .xls or .xlsm that contain a text and if found place full directory name and file name on new workbook. I've found this by Allen Wyatt but it doesn't search including subfolders. It also doesn't search both .xls and .xlsm at the same time but thats not a big deal unless someone feels like adding that in too.

    Can someone either assist in modifying the code below to including searching including subfolders or write a new code? Much thanks.

    Please Login or Register  to view this content.
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Search Text Excel All files & Subfolders

    This requires Microsoft Scripting Runtime to be set. In the VBA Editor, click Tools...References....Microsoft Scripting Runtime. Run the ListFileNames macro. The result will be returned to "Sheet1" of the workbook with the macro.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] list of subfolders in folder - without files and sub-subfolders
    By MartyZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2022, 10:56 AM
  2. [SOLVED] Search for files in folders and subfolders
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 08:43 AM
  3. VBA directory search for files stored on mac & in subfolders
    By thebute in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2014, 04:02 AM
  4. [SOLVED] Files within Multiple SubFolders and SubFolders Within It
    By codeslizer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-18-2013, 04:18 AM
  5. [SOLVED] Search subfolders in excel 2010
    By greasybob in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-08-2012, 07:03 PM
  6. replace text in files within subfolders
    By pieros in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2005, 10:05 AM
  7. [SOLVED] copy subfolders, replace text in files and save files in copied subfolders
    By pieros in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2005, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1