Open the code designer and double click on the sheet object which you want to try naming then paste this code.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error Resume Next
If Target.Address = "$A$1" Then Sheet1.Name = Target
If Err Then Target = ActiveSheet.Name
End Sub
A worksheet's Name property means Label on Worksheets Tab.
Error handling stands for avoid names.
A1 cell used as the label source.
This code will be executed everytime cell A1 changed then if the text value in A1 is allowed to use as the sheet name then sheet name on the tab would be changed.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.