I have a collection of files (jpg, zip, xlsm, all kinds of different formats) in a specific folder which all have the string "MONTH" at the end of their file names.
I need to loop through each file in the folder replace "MONTH" with the contents of an Inputbox, allowing a user to enter any month they want.
I created the following sub, and although it doesn't return any errors, the file names aren't changing. Can't seem to figure out where I'm going wrong, help?
Sub FileNameAddMonth()
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder("C:\User\Desktop\MonthlyReports")
Dim Currentmonth As String
Currentmonth = InputBox("Please input the current month")
For Each file In Folder.Files
sNewFile = file.Name
sNewFile = Replace(sNewFile, "MONTH", Currentmonth)
Next
End Sub