EzGoingKev
Registered User.
- Local time
- Today, 11:13
- Joined
- Nov 8, 2019
- Messages
- 197
Good morning.
I am using this code to move a ZIP folder from desktop to an archive folder:
The ZIP folder is a data export from a web based app. If I am making a lot of changes to the data I will sometimes export multiple ZIP files to QC the data as I go along. All the ZIP folder exports have the same name.
I know I can add an IF statement to check to see if the ZIP folder already exists and have it add "(1)" to the name so it will be different. I do not know how to set it to add "(2,3...)" if I download more than one copy.
Is there something that can either be added to the code or a different method to move the folder so it does what I would like to do?
I am using this code to move a ZIP folder from desktop to an archive folder:
Code:
Dim filPath
Dim folPath As String
filPath = Dir(C:\Users\EzGoingKev\ & "*.zip")
folPath = "C:\Users\EzGoingKev\ArchiveFolder\"
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.MoveFile filPath, folPath
The ZIP folder is a data export from a web based app. If I am making a lot of changes to the data I will sometimes export multiple ZIP files to QC the data as I go along. All the ZIP folder exports have the same name.
I know I can add an IF statement to check to see if the ZIP folder already exists and have it add "(1)" to the name so it will be different. I do not know how to set it to add "(2,3...)" if I download more than one copy.
Is there something that can either be added to the code or a different method to move the folder so it does what I would like to do?