that allows you to quickly rename all the files in a specified directory.
How to batch rename multiple range names in Excel?
To rename a range name is easy and usually used in our daily Excel work, but to batch rename multiple range names will be troublesome. In this article, I introduce a macro code to quickly batch rename multiple range names in Excel.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
Supposing there are several range names in a workbook as below screenshot shown, now I will rename them by adding a prefix.
1. Press Alt + F11 keys to enable the Microsoft Visual Basic for Applications window, and click Insert > Module. See screenshot:
2. Paste below code to the Module script, and press F5 to run the code.
VBA: Rename range names
Sub RenameCells() Dim n As Name For Each n In ThisWorkbook.Names n.Name = "KUTOOLS_" & n.Name Next n End Sub
Then all range names have been renamed by adding the specified prefix. See screenshot:
Note: In the above code n.Name = "KUTOOLS_" & n.Name, you can change KUTOOLS to other string as you need.
Tip.If you want to quickly rename multiple sheets, please try to use the Kutools for Excel’s Rename Multiple Worksheets feacture as shown in the following screenshot. It’s full function without limitation in 60 days, please download and have a free trial now.