


In the VB Editor window, click on the ‘View’ option in the menu and then click on Immediate Window.This will open the Visual Basic Editor backend
#RENAME SHEET IN EXCEL CODE#
The above code uses a VBA loop (the For Next loop) to go through each sheet in the workbook and change the name by adding the specified prefix.īelow are the steps to use this VBA macro code in Excel: In such a case, you can use a simple VBA code in the immediate window to get this done in a snap.īelow is the VBA code that will add the prefix “ 2020 – ‘ in front of all the sheet names: For Each sh In Worksheets: sh.Name = "2020 - " & sh.Name: Next sh But in case you have a lot many, this could be tedious and error-prone. While you can do this manually (using the methods shown above) if you only have a few worksheets. Sometimes, you may have a need to add a prefix or a suffix to all the sheets in your workbook. Rename Sheets Using VBA – Add Prefix/Suffix to All Sheet Names in One Go While this method exists, I always prefer using the mouse double-click technique to change the name of the sheet. To change the name of some other sheet, you first need to activate it and then use the above steps.

This method would only allow you to change the name of the current sheet. Enter the name that you want for the sheet.This will get the sheet name into edit mode In the Cell group, click on the ‘Format’ option.You can also access the option to rename sheets through the Excel ribbon: Rename Sheets Using the Format Option in the Ribbon
#RENAME SHEET IN EXCEL PRO#
Pro Tip: In case you want to move to the next sheet, you can use the keyboard shortcut Control + PageUp/PageDown (hold the Control key and then press the PageUP key to move to the next sheet or PageDown key to move to the previous sheet. While this is not one of the easy keyboard shortcuts, once you get used to it, you may find it a better way to rename sheets in Excel. You need to press these keys one after the other in a succession. If you prefer using the keyboard and don’t want to switch to a mouse just to rename a sheet, you can also use the following keyboard shortcut (for Windows). Related: Increase Excel Tab Numbering as You Create a Copy Rename Sheets with a Keyboard Shortcut Once you have the cursor where you want to add the text, enter in manually. If you want to rename multiple sheets, you need to do these above steps for all the sheets.Īlso, if you want to add a prefix/suffix to the sheet name, you the arrow keys to move the cursor when you’re in the edit mode in the tab.
