I have the following procedure part:
Dim strFileName As String
'TODO: Specify path and file spec
Dim strFolder As String: strFolder = "C:\temp\"
Dim strFileSpec As String: strFileSpec = strFolder & "*.*"
strFileName = Dir(strFileSpec)
Do While Len(strFileName) > 0
'TODO: replace Debug.Print by the process you want to do on the file
'Dim strFilePath As String: strFilePath = strFolder & strFileName
strFileName = Dir
I would like to take as a reference to add a full procedure in personal.xlsb to add datestamp at the end of the various files located in a reported folder (drill down subfodlers is not needed).
The idea is to have the following:
1-Display inputbox: "Select Range in which is reported reference folder"
2-Rename the various files located in the reported by adding the following string at the end of the file name: Left(flName, Len(flName) - 4) & "_" & Format$(Date, "yyyymmdd") _
& Format(Now, "hhmmss") &
-If reported reference folder doesn't exist exit sub and display input box "Reference folder doesn't exist"
-Exit sub if user click cancel in the first input box
If you have questions, please contact me.