Hello!
I have an odbc report that inserts data (product number) with trailing spaces. I currently have a macro that inserts an image from a specified file location based on the selected cell value. It works great when I manually enter a product number to run the macro off of as it obviously does not contain trailing spaces.
I would like for the macro to search the specified file location based on the leading characters of the value in the selected cell and return the closest match possible. All with a msgbox that the exact file was not found but "the closest file is ...".
For example, I need an image returned for product number 12345WHITE(+SPACES). If I only have a file named 12345, I'll need a message box = "12345WHITE not found. Inserting 12345" and insert the correspondingt image. If the folder also contains 12345WHI, it should attemp to return this file instead as it's the closest match.
Can this be done?
Thanks ahead to you wizards!
E
Bookmarks