Sheet Tab name

P

pronto

Is there a way to link the name of the sheet tab with a cell? I jus
want to put a text value in a certain cell and the sheet tab name woul
show that text value.

Thanks in advance
 
F

Frank Kabel

Hi
you can put this kind of code in your worksheet_change
event (of your worksheet module). e.g. try the following
code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit
Sub
On Error GoTo errhandler
Application.EnableEvents = False
Me.Name = Target.Value
errhandler:
Application.EnableEvents = True

End Sub


Now each time cell A1 changes your sheet name changes as well
 
G

Greg Wilson

This assumes that you want the name change to occur
automatically when the value of the cell is changed. Paste
to the worksheet code module. Change the cell address to
suit:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$10" Then ActiveSheet.Name =
Target.Value
End Sub

Regards,
Greg
 
I

icestationzbra

check to see if this works for you:

sheet1.name = sheet1.range("a1").valu
 
Top