+ Reply to Thread
Results 1 to 10 of 10

Marco to Open all contents (.xlsm) in a folder and search each file for a word

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Ontario,Canada
    MS-Off Ver
    Windows 7
    Posts
    4

    Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Hi all,

    I'm looking for help to create Macro to open contents in folder and search for the word "troubleshoot" in each file. The folder contains 287; having to open all the files is time consuming.

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    So this macro will open all files in a folder:

    Please Login or Register  to view this content.
    but I don't know what you want the code to do WHEN/IF it finds troubleshoot anywhere. What are you wanting at that point?

    Also is there a set number of sheets in each file, do they have only one sheet or multiple variable worksheets?
    Last edited by mikeTRON; 07-11-2014 at 12:38 PM.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

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

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    This will open all folders and search each cell in columns A:IV for the word troubleshoot however exactly what miektron said what do you want it to do when you find the word?

    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.

  4. #4
    Registered User
    Join Date
    06-26-2014
    Location
    Ontario,Canada
    MS-Off Ver
    Windows 7
    Posts
    4

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Thanks guys!

    After finding the files that contain the word "troubleshoot", I'd like to add the contents in Cell E23 into a new workbook/the workbook that contain the Macro(above).

    Thanks again.

  5. #5
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Does troubleshoot always fall in ONE particular cell?
    Are there multiple sheets in each workbook?
    What else can you tell us to help fine tune this thing?

    Can you post a sample dataset to illustrate what you are wanting?

  6. #6
    Registered User
    Join Date
    06-26-2014
    Location
    Ontario,Canada
    MS-Off Ver
    Windows 7
    Posts
    4

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Troubleshoot would be in a merge cell/cells, C38:T41 or C42:T45 or C46:T49 or C50:T53.

    There are multiple sheets in each workbook. Sheet names are WO1, WO2 and WO3.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    This checks all sheets in all files in a folder and puts the file names and cell addresses in a range.
    The workbook with this code in it should not be in the same folder.

    Please Login or Register  to view this content.
    You can add the line to copy E23 into your workbook
    Sorry, it checks the first column only.
    You can change
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    Last edited by jolivanes; 07-11-2014 at 01:35 PM. Reason: Add info

  8. #8
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Ahh I must have been slow to respond, but mine is very similar to the above.

    AllFilesOpen.xlsb

  9. #9
    Registered User
    Join Date
    06-26-2014
    Location
    Ontario,Canada
    MS-Off Ver
    Windows 7
    Posts
    4

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    Thanks a lot, I really appreciate the help.

    Works Great!

  10. #10
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Marco to Open all contents (.xlsm) in a folder and search each file for a word

    If it is solved can you mark it as such?

+ 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. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  2. Search a word file in a specific folder and copy text to excel
    By corinereyes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2012, 08:15 AM
  3. Macro to search folder including subfolders for file and open
    By kiraexiled in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2012, 02:45 PM
  4. Replies: 2
    Last Post: 03-26-2012, 07:12 PM
  5. Replies: 7
    Last Post: 04-15-2006, 04:20 PM

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