Can you upload an example showing what your table layout looks like currently? Are all files in the same folder? Does your table within XL have the folder address, or just file name?
Hi Luke,Perfect, that should work nicely. Assumptions are that the folder path is listed in cell B2. To delete a file, put something in col E. Macro will look for any constant value (not a formula) and delete that file.
AMAZINGDoh. Guess it helps if I actually upload the file...![]()
Hi Luke,Doh. Guess it helps if I actually upload the file...![]()
Set rngFound = .Range("A:A").Find(fileInFolder.Name)
Set rngFound = .Range("A:A").Find(what:=fileInFolder.Name, lookat:=xlWhole)
Worked like a charmBah, I see the problem. Check out line 40 in the code:
Code:Set rngFound = .Range("A:A").Find(fileInFolder.Name)
If should be this:
Code:Set rngFound = .Range("A:A").Find(what:=fileInFolder.Name, lookat:=xlWhole)
Previous line of code allowed a partial match to be found. So, when you already had found a file called
10ValidoValoresAtualizadosdoWACC120313.pdf
and then it looked for "13.pdf"
it found a partial match and was counting it.By changing the code to say look at whole cell, that issue should be resolved.