I've got a workbook (I didn't create it) I've been using for a while, which searches through closed workbooks to find a search item. It works well, but I'd like to enhance it a bit and don't know how to achieve what I want. I've attached the workbook.
After keying in the search term, the next action is to choose the file location. Clicking the button brings up the "Browse for Folder" box. That's where I want to make a change. I have to shift through various drives and folders to get to the folder I want to search, and often I have multiple searches to do. Since the present behaviour always start my search at the same folder view I'm constantly having to drive over the same route to get to the folder I'm searching. I'd like to have this box open up to the last folder accessed, instead of to the current default view.
I've pasted the full code below, as well as attached the workbook. Much of it is over my head, but I think the change that needs to be made is in the "GetDirectory" function, specifically this line:
I don't understand that bit of code, but I think what it's doing is telling the "Browse for Folder" box to open to my desktop (it's actually my computer, with Desktop at the top).
I thought that somehow I could capture the last accessed folder to a cell (say, M2), and have the code refer to that cell as the clue to where to start the next search, but don't know how to set that up.
Another bit I'd like to add would be the ability to search for all the items in a list, instead of only for one item at a time. It could either go through all the workbooks looking for one item first, or look for all of the items in a single workbook and then move on to the next. Making this kind of change would involve some structure changes to show pertinent information, because rather than just listing the appropriate workbook it would have to show what items in the list correspond to that workbook.
I appreciate you taking the time to read this post, and for any help you're able to provide.
Thanks,
John
Bookmarks