Equivalent to clicking the Rename command on the Sheet submenu of the Format menu. Renames a sheet in a workbook.
Syntax
WORKBOOK.NAME(oldname_text, newname_text)
WORKBOOK.NAME?(oldname_text, newname_text)
Oldname_text is the name of the sheet that you want to rename.
Newname_text is the new name of the sheet.
Remarks
If you try to rename a sheet using a sheet name that already exists in the workbook, Microsoft Excel displays an error message and interrupts the macro.
If the structure of the workbook is protected, you cannot rename any of the sheets in the workbook.
Return to index