Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
With Me
If .Range("A1") = "" Then
.Name = .Name
Else
.Name = .Range("A1").Value
End If
End With
enditall:
Application.EnableEvents = True
End Sub
Gord Dibben MS Excel MVP
>Mike,
>
[quoted text clipped - 23 lines]
>> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
>> > and any help would be appreciated. Thanks!
John G. - 08 May 2008 19:19 GMT
Thanks Gord and Mike. Making life simpler, or complex, depends on what else
this leads to. Thanks a bunch!
> Private Sub Worksheet_Change(ByVal Target As Range)
> On Error GoTo enditall
[quoted text clipped - 39 lines]
> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
> >> > and any help would be appreciated. Thanks!
John G. - 08 May 2008 19:33 GMT
Gord,
This returns the right value only the cell shows a square symbol between the
round number and the fraction. I tried to paste it here, but it did not come
over the same.
> Private Sub Worksheet_Change(ByVal Target As Range)
> On Error GoTo enditall
[quoted text clipped - 39 lines]
> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
> >> > and any help would be appreciated. Thanks!
Gord Dibben - 09 May 2008 01:50 GMT
John
I think you have responded to the wrong posting.
No round numbers or fractions that I can see in my post.
But square symbols are usually linefeeds within a cell.
Gord
>Gord,
>This returns the right value only the cell shows a square symbol between the
[quoted text clipped - 44 lines]
>> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
>> >> > and any help would be appreciated. Thanks!
DKM - 09 May 2008 19:16 GMT
Great sub, however in MY case I need 4 sheets to be renamed based on cells in
sheet 1. Can anyone help?
DKM - 09 May 2008 19:34 GMT
Sorry, I should have been more specific.
I have a that has 8 sheets.
Sheet 1 is the master sheet.
All sheets have default names. (contractor1, contractor2....)
Once I enter the contractor name into the Master sheet (C4) I want sheet 2
to update to the value in sheet 1, C2. Similar for sheet 1, D2. And for
other cells in the master sheet.
thanks in advance.
dan
Scott - 08 Jul 2008 22:56 GMT
G’Day Gord
This works a treat and is simple to understand. I have one remaining
question.
The cell I am referencing (B1 in sheet 2) has a CONCATENATE function
(joining "sheet1!A1,A1" ) . When I change A1, I sheet2, B2 also changes as
does the Sheet2 sheet name. However, when I change the value in Sheet1!A1
there is no change to the Sheet2 sheet name, even though a B1 has changed? I
have tried "F9", even closing and opening the workbook but I can't seem to
force a change.
Is there a simple solution?
Thanks
Scott
> Private Sub Worksheet_Change(ByVal Target As Range)
> On Error GoTo enditall
[quoted text clipped - 39 lines]
> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
> >> > and any help would be appreciated. Thanks!
Gord Dibben - 08 Jul 2008 23:50 GMT
You need a calculate event for that.
Private Sub Worksheet_Calculate()
On Error GoTo enditall
Application.EnableEvents = False
With Me
If .Range("B1") = "" Then
.Name = .Name
Else
.Name = .Range("B1").Value
End If
End With
enditall:
Application.EnableEvents = True
End Sub
Assumes code is in Sheet2 and B1 has formula
=CONCATENATE(Sheet1!A1,A1)
Gord
>GDay Gord
>
[quoted text clipped - 57 lines]
>> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
>> >> > and any help would be appreciated. Thanks!
Scott - 09 Jul 2008 00:38 GMT
Gord,
You are a gentlemen and a scholar, thanks very much
Scott
> You need a calculate event for that.
>
[quoted text clipped - 79 lines]
> >> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
> >> >> > and any help would be appreciated. Thanks!
Gord Dibben - 09 Jul 2008 00:56 GMT
Good to hear you got sorted out.
Thanks for the feedback.
Gord
>Gord,
>
[quoted text clipped - 85 lines]
>> >> >> > I have seen some pretty elaborate ways of renaming tabs. I am new at Excel
>> >> >> > and any help would be appreciated. Thanks!