Now, copy paste the below VBA code into VBEditor and run the program. The file names of files 1,2,3,4 and 5 gets converted into A, B, C D and E respectively.
Sub FileRename()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim n As String
Dim m As String
Dim RowCount As Integer
Sheets("Sheet1").Select
RowCount = Application.WorksheetFunction.CountA(Range("A:A"))
For i = 2 To RowCount
n = Cells(i, 1)
m = Cells(i, 2)
Workbooks.Open (n)
ActiveWorkbook.SaveAs (m)
ActiveWorkbook.Close
Kill (n)
ThisWorkbook.Save
Next
End Sub
Here is a video demonstration to the above Example.
Use Coupon Code 580EDUNF83 to get additional 20% discount
Use Coupon Code 580EDUNF83 to get additional 20% discount
0 comments:
Post a Comment