First of all, I don't really know VBA more than just piecing together other people's work (so please dumb down your responses as much as possible).
So I would like to have a function that displays a filename within a cell. The filename I need to display will start with "cost" and have a date at the end (not always the same number of characters). I need to search a folder for all files that contain that text and return the last modified one.
I found this VBA code that returns the last modified file, but only filters based on the extension (which I would like to keep in the code as well).
I found a code that would filter the files but don't know how or where exactly to put it in:Please Login or Register to view this content.
Any help would be greatly appreciated.Please Login or Register to view this content.
EDIT: By the way, I would like to have the part of the filename used to filter be taken from a cell. In other words, if the beginning of the filename I am searching for changes, I would like for users to be able to update the search criteria in a cell rather than having to open the VBA code. This isn't necessary but would be a plus.
Bookmarks