Quote Originally Posted by gmayor View Post
If Column G of your worksheet contains a folder location, then what are the 'documents' that are in that folder? Are they workbooks, in which case where does the code need to look for the company name i.e. sheet name and column. If they are Word documents, where in the documents would the macro look for the company name? If they are some other type of 'document', please be more specific.

The principles involved are easy enough. You would loop through the 'documents' and look for the string. If found add the folder and filename to a Collection. Then when all have been searched, add the members of the collection as attachments.
so they can be pdf files or xlsx files. But each company's file will have their name somewhere in the name of the file:

example:
TESLA receipt oct-2019.pdf
TOYOTA receipt oct-2019.pdf
TESLA invoices oct-2019.xlsx
TOYOTA invoices oct-2019.xlsx
HONDA report oct-2019.pdf


I'm assuming that a wildcard would be used point to the value in column A to complete the folder path that is in column G, example
Path: sheet1.range("G" & row_number).value & "*" sheet1.range("A" & row_number).value "*" ???? (as you can see I'm lost)
maybe loop until all files that contain that text are attached.

let me know if there are any questions