ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Naming of tabs from data in a worksheet (https://www.excelbanter.com/excel-worksheet-functions/231721-naming-tabs-data-worksheet.html)

Christine

Naming of tabs from data in a worksheet
 
Hello, I've looked for a post on this and in Excel help but drawing a blank.
Hoping one of you might have an answer for me.

Is there a formula that will insert the value on spreadsheet tab into a
cell€¦.or vice versa - the value in a cell into the tab?

For instance, I would like to put a name in cell A2 and have the tab for
that worksheet be the same as whatever the value in A2 is.

Hope that makes sense.

Regards,

Christine

Mike H

Naming of tabs from data in a worksheet
 
Hi,

You need code for that. Right click your sheet tab, view code and paste the
code below in. If you type a legal filename into A2 the sheet is re-named.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$2" Then
On Error Resume Next
ActiveSheet.Name = Target.Text
End If
End Sub

Mike

"Christine" wrote:

Hello, I've looked for a post on this and in Excel help but drawing a blank.
Hoping one of you might have an answer for me.

Is there a formula that will insert the value on spreadsheet tab into a
cell€¦.or vice versa - the value in a cell into the tab?

For instance, I would like to put a name in cell A2 and have the tab for
that worksheet be the same as whatever the value in A2 is.

Hope that makes sense.

Regards,

Christine


Christine

Naming of tabs from data in a worksheet
 
You folks on this site are so smart....and so helpful!!! Thank you very much.

Christine

"Mike H" wrote:

Hi,

You need code for that. Right click your sheet tab, view code and paste the
code below in. If you type a legal filename into A2 the sheet is re-named.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$2" Then
On Error Resume Next
ActiveSheet.Name = Target.Text
End If
End Sub

Mike

"Christine" wrote:

Hello, I've looked for a post on this and in Excel help but drawing a blank.
Hoping one of you might have an answer for me.

Is there a formula that will insert the value on spreadsheet tab into a
cell€¦.or vice versa - the value in a cell into the tab?

For instance, I would like to put a name in cell A2 and have the tab for
that worksheet be the same as whatever the value in A2 is.

Hope that makes sense.

Regards,

Christine



All times are GMT +1. The time now is 04:48 PM.

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