View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Automating Tab names

That code needs to be in the Thisworkbook code module, and it should be

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$2" Then
sh.Name = Target.Value
End If
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Stilla" wrote in message
...
Hi.. On this site, I found this VBA code for naming tabs with entry in a
particular cell, but it's not working... I only changed the "a2" part to
correspond to my particular case, and left everything else alone. What
could be wrong?
__________
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
ActiveSheet.Name = Range("a2").Value
End Sub
___________

Thanks in advance