ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can I conditionally format tab names in excel? (https://www.excelbanter.com/excel-worksheet-functions/33000-can-i-conditionally-format-tab-names-excel.html)

fullers

Can I conditionally format tab names in excel?
 
I am looking to automatically name the tabs in my spreadsheet based on a
name/data within that worksheet. Is this possible

Bob Phillips

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

On Error GoTo wb_exit
Application.EnableEvents = False

With Target
If .Address = "$H$1" Then
Sh.Name = .Value
End If
End With

wb_exit:
Application.EnableEvents = True
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

"fullers" wrote in message
...
I am looking to automatically name the tabs in my spreadsheet based on a
name/data within that worksheet. Is this possible





All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com