Excel Tips

How To Rename Multiple Files Of A Folder In Excel?




If there are multiple files that you want to rename, first, you can list the old file names in a column of worksheet, and then enter the new filenames that you want to replace with. To quickly list all files in worksheet, you can use the Kutools for Excel’s Filename List utility.

After installing Kutools for Excel, please do as follows:( Free Download Kutools for Excel Now )
1. Click Enterprise > Import / Export > Filename List, see screenshot:
doc-rename-multiple-files-1
2. In the Filename List dialog box, click doc-rename-multiple-files-1 button to choose the file folder that you want to list the files, and then click All files from the Files type, see screenshot:
doc-rename-multiple-files-1
3. Then click OK button, all the filenames have been list in a column of a new worksheet, as well as some file attributes, and now, you can delete other unwanted columns and only leave the File Name column, see screenshot:
doc-rename-multiple-files-1


 Rename Multiple Files Of A Folder In Excel With VBA Code


After listing all original filenames in one column A, and you should type new filenames in column B as following screenshot shown:
doc-rename-multiple-files-1
And here I will talk about a VBA code which may help you to replace the old filenames with the new filenames at once. Please do with following steps:
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications Window.
2. Click Insert > Module, and paste the following macro in the Module window.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Sub RenameFiles()
'Updateby20141124
Dim xDir As String
Dim xFile As String
Dim xRow As Long
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
If .Show = -1 Then
    xDir = .SelectedItems(1)
    xFile = Dir(xDir & Application.PathSeparator & "*")
    Do Until xFile = ""
        xRow = 0
        On Error Resume Next
        xRow = Application.Match(xFile, Range("A:A"), 0)
        If xRow > 0 Then
            Name xDir & Application.PathSeparator & xFile As _
            xDir & Application.PathSeparator & Cells(xRow, "B").Value
        End If
        xFile = Dir
    Loop
End If
End With
End Sub
3. After pasting the code, please press F5 key to run this code, and in the Browse window, select the folder which you want to change the filenames in, see screenshot:
doc-rename-multiple-files-1
4. And then click OK, all the old filenames have been replaced by the new filenames immediately. See screenshots:
doc-rename-multiple-files-12doc-rename-multiple-files-1
Notes:
1. When you list your old and new filenames, the file extension must be included.
2. In the above code, the reference A:A indicates the old filenames list you want to rename, and reference B contains the new filenames that you want to use, you can change them as your need

-----------------------------------------------------------------------------------------------------------------------------

How to Convert Date Format in Excel mm/dd/yyyy to dd/mm/yyyy

How To Convert Dd/Mm/Yyyy To Mm/Dd/Yyyy In Excel Cells?

In Excel, the standard date format is mm/dd/yyyy, but in some cases, the dates in the files you received or import are in the format dd/mm/yyyy, how can you change these dates from dd/mm/yyyy format to mm/dd/yyyy in Excel as below screenshot shown?
doc ddmmyy mmddyy 1

Convert dd/mm/yyyy to mm/dd/yyyy with Formulas

Convert dd/mm/yyyy to mm/dd/yyyy with Text to Column


 Convert Dd/Mm/Yyyy To Mm/Dd/Yyyy With Formulas

There is a formula that can quickly convert dd/mm/yyyy to mm/dd/yyyy date format.

Select a blank cell next to the dates you want to convert, type this formula =DATE(VALUE(RIGHT(A9,4)), VALUE(MID(A9,4,2)), VALUE(LEFT(A9,2))), and drag fill handle over the cells which need to use this formula.
doc ddmmyy mmddyy 2

Note: A9 is the date you use to convert.


Add Same Text To A Specific Location Of Each Cell In Excel

How could you add text or characters to the beginning of multiple cells, or add text or characters to the end of cells or insert text or characters between existing text? With Add Text utility of Kutools for Excel, you can quickly apply the following operations: . Click for full-featured free trial in 30 days!
doc add text 6
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in full future 30 days.

 Convert Dd/Mm/Yyyy To Mm/Dd/Yyyy With Text To Column

Also, you can split the date format into columns by the Text to Columns feature, and then combine with a formula with the new order.

1. Select the dates you want to convert, and click Data > Text to Columns. See screenshot:
doc ddmmyy mmddyy 3

2. In Step 1 of Convert Text to Columns Wizard, check Delimited option. See screenshot:
doc ddmmyy mmddyy 4

3. Click Next, and check Other, and type / into the next to text box. See screenshot:
doc ddmmyy mmddyy 5

4. Click Next, and select a cell to output the data in Destination box. See screenshot:
doc ddmmyy mmddyy 6

5. Click Finish. Then the dates have been split into columns.
doc ddmmyy mmddyy 7

6. Select a blank cell, and type this formula =C1&"/"&B1&"/"&D1, drag auto fill handle down to the cells needed this formula.

doc ddmmyy mmddyy 8
doc arrow down
doc ddmmyy mmddyy 9

Note: In the formula, C1, B1 and D1 are the delimited cells.


Relative Articles:

Courtesy:  https://www.extendoffice.com/documents/excel/4646-excel-convert-dd-mm-yyyy-to-mm-dd-yyyy.html#a1


Comments

Popular posts from this blog