What I mean by this is if I wanted a specific file path to be excluded such as "C:\test with spaces\subfolder 1\file1.txt" I can change the code from:if I wanted the complete path for each specific folder or specific file to be excluded...
toFor i = LBound(aryFiles) To UBound(aryFiles) If UCase(p.Name) = UCase(aryFiles(i)) Then Exit Function Next iinstead of file1.txt being excluded everywhere in every subfolder, by changing the p.Name to p.Path, i can pin-point the exact file path to be excludedFor i = LBound(aryFiles) To UBound(aryFiles) If UCase(p.Path) = UCase(aryFiles(i)) Then Exit Function Next i
That tells Redim Preserve how many more spaces to allocate. I had it set low for testing, but might slow things downDo you mean resizing the array by 10 at code execution?Const incFilesFolders As Long = 10
It seems like for long folder/file paths which is 246 characters in length in cell A1, there is a run-time error 9 - subscript out of range occuring andis highlighted after i click debug under the sub "isFolderExcluded"For i = LBound(aryExcludes) To UBound(aryExcludes)




Reply With Quote