Hi,
i am working on office 2007 with Windows XP.
i have the following code already available:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'one cell at a time
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Sh.Range("A1")) Is Nothing Then
Exit Sub 'not in A1
End If
On Error Resume Next 'just in case it's not a valid name
Sh.Name = Sh.Range("a1").Value
If Err.Number <> 0 Then
MsgBox Sh.Name & " cannot be renamed to: " & Target.Value
Err.Clear
End If
On Error GoTo 0
End Sub
However this code does not enable me to update the sheetname when the cell A1 is a formula and when the formula in A1 is updated.
I would like to have the sheet name updated as soon as the formula in AD1 is updated.
Hope someone can help.
Regards,
Nicolas
i am working on office 2007 with Windows XP.
i have the following code already available:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'one cell at a time
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Sh.Range("A1")) Is Nothing Then
Exit Sub 'not in A1
End If
On Error Resume Next 'just in case it's not a valid name
Sh.Name = Sh.Range("a1").Value
If Err.Number <> 0 Then
MsgBox Sh.Name & " cannot be renamed to: " & Target.Value
Err.Clear
End If
On Error GoTo 0
End Sub
However this code does not enable me to update the sheetname when the cell A1 is a formula and when the formula in A1 is updated.
I would like to have the sheet name updated as soon as the formula in AD1 is updated.
Hope someone can help.
Regards,
Nicolas