I am looking for VBA to add to my macro that will increment the file name if the file name already exists.
Current Code:
Dim filepath As String Dim
Just put a conditional loop with Dir()
Dir()
Do While ((Dir(filepath & tdfilename)) <> Empty) inc = inc+1 filedate = Format(Now, "MMDD") & "." & Format(inc, "00") tdfilename = "TD" & filedate & filelist Loop