Mostly everything is sorted out, except one vital issue.
worksheet contains:
Column A with an 11 digit number followed by -1 (referenced in this message as "xxx" for the 11 digit number, and "-#" respectively) [column A contains: "xxx" & "-1"]
What I hope to achieve
Code to search folders and subfolders for the 11 digit number ("xxx") if found replace the cell contents with the next available "-#".
example
Column A contains:
05022017001-1
04072017001-1
17062017001-1
Code searches folders and finds:
05022017001-1, 052017001-2, 052017001-3
04072017001-1
and doesn't find any files named 17062017001-1
Code changes Column A contents to:
05022017001-4
04072017001-2
17062017001-1 (It didn't find any 17062017001-1 so it left it alone)
what I currently have is
The code below which searches folders and replaces cell contents in column A properly (there will never be an instance where anything greater then -6 is needed so it starts there and reverse searches [I think])
The problem with the code below
Everything works perfect, except if it doesn't find any instances of the "xxx" number in any folders or subfolders it still changes column A contents to "xxx-2"
What I need
Code to be changed so that If it doesn't find any "xxx" in folders and subfolders it leaves contents of Column A alone and moves on to the next Row in Column A
Bookmarks