In my head this sounded quite simple, but I am quickly discovering I have more questions on how to proceed than I initially thought. Such as, how do I loop it through several directories? How do I get it to not include LogNumber "1" in LogNumber "1001"? etc
I will try to keep it simple and I can change cell and folders etc later.
Let's say, I have a sheet with the table as such in columns A and B, with the headers on row 1;
I have files in several folders, in this case, to reflect the table.
"1001 Supplier A.pdf" is in folder "C:\Documents\Files\NBI"
"101001 Supplier A.pdf" is in folder "C:\Documents\Files\Authorized"
"2001 Supplier B.pdf" is in folder "C:\Documents\Files\NBI"
"202001 Supplier C.pdf" is in folder "C:\Documents\Files\Authorized"
"2003 Supplier B.pdf" is in folder "C:\Documents\Files\Awaiting Check"
"3004 Supplier F.pdf" is in folder "C:\Documents\Processed\Rejected"
I would like the vba script to search through the folder locations above for a file containing a matching Log Number. Then, if such a file exists, it will put into Document Tracker column some relevant text, not necessarily the folder name. So if its in folder "NBI" it says "NBI" in the relevant cell.
Any ideas?
I will try to keep it simple and I can change cell and folders etc later.
Let's say, I have a sheet with the table as such in columns A and B, with the headers on row 1;
Log Number | Document Tracker |
---|---|
1001 | NBI |
101001 | Authorized |
2001 | NBI |
202001 | Authorized |
2003 | Awaiting Check |
3004 | Rejected |
"1001 Supplier A.pdf" is in folder "C:\Documents\Files\NBI"
"101001 Supplier A.pdf" is in folder "C:\Documents\Files\Authorized"
"2001 Supplier B.pdf" is in folder "C:\Documents\Files\NBI"
"202001 Supplier C.pdf" is in folder "C:\Documents\Files\Authorized"
"2003 Supplier B.pdf" is in folder "C:\Documents\Files\Awaiting Check"
"3004 Supplier F.pdf" is in folder "C:\Documents\Processed\Rejected"
I would like the vba script to search through the folder locations above for a file containing a matching Log Number. Then, if such a file exists, it will put into Document Tracker column some relevant text, not necessarily the folder name. So if its in folder "NBI" it says "NBI" in the relevant cell.
Any ideas?