@jindon

Thank you for your fast reply, I don't know if you realized that I just edited my message few minutes ago, so I'm not sure if you took into consideration the previous message...

Anyway, I have just tried your modifcation it and I keep having the same issue, the macro works properly when I select the path deep in the subfolder that I know that I have the files, but it doesn't work If I choose the main folder that should apply the condition in A1.

Attachment 871491

and inside the 3154, etc... folders there are subfolders such as Commercial, Performance, etc... and then inside you can find the files that contains the condition in A2