Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Public Sub RenameFiles() Dim fso As Scripting.FileSystemObject Dim vFiles As Variant Dim i As Long Dim oFile As Scripting.File Dim sFilePath As String Const cFILE_PATH As String = "C:\Temp" Set fso = New Scripting.FileSystemObject vFiles = ActiveSheet.Cells(1).CurrentRegion.Value For i = 1 To UBound(vFiles, 1) With fso sFilePath = .BuildPath(cFILE_PATH, vFiles(i, 1)) If .FileExists(sFilePath) Then Set oFile = .GetFile(sFilePath) oFile.Name = vFiles(i, 2) End If End With Next i End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.