Hello,
I am trying to code in VBA to Create a Directory using values from cells if the Directory doesn't exist and then save the workbook into that Directory using same values from the cell.
But if the Directory already exist I would like for the application to skip creating the directory and save the workbook in the existing Directory with the same values.
The tricky part that I'm on right now is if the workbook already exist I would like to add to the tail end of the name of the file.
So I guess I'm looking for a loop to determine the next sequence as towhat I can name the file so as to not replace any workbboks in the directory
Example:
9001_1.xlsx
9001_2.xlsx
9001_3.xlsx
So the next available number title would be 9001_4.xlsx
Starting off at 9001_1.xlsx it would loop through trying to save and everytime the value came up <> "" then it would move on to the next untill the value = "" and then saved (I hope I explained that right)
Please let me know if I wasn't clear enough. An example of my code is as far as I have gotten. I guess I just really need the last loop part. And if anyone may have any recomendations to make it go faster or a better structure, I am all for it. Thank you
Bookmarks