I have code that will find and list subfolders, I need help writing an if...then...else statement that basically says if the subfolder is already listed, don't add it to list, if not, then add at end of list. I've tried all I could, but I don't think I'm putting it in the right place in the code, or something. Here is my code:
Thanks!
Code:
'Lists Folders '
Worksheets(1).Activate
Dim row As Integer
Dim SearchFolders As Variant
row = 3
LookInTheFolder = "I:\projects2\Koch\58MY8900\PROCESS\2013 Work (Phase 3)\DIH_Sulfolane\Equipment"
Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
For Each SearchFolders In FileSystemObject.GetFolder(LookInTheFolder).SubFolders
Cells(row, 1) = Mid(SearchFolders, InStrRev(SearchFolders, "\") + 1)
row = row + 1
Next SearchFolders
Thanks!