Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stilla
 
Posts: n/a
Default Automating Tab names

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

  #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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default Automating Tab names

Stilla
Not sure of what you want to do. I think you want the name of each
sheet to change to the value of A2 when that sheet is selected (activated).
If this is so use this: Post back if this is not what you want. HTH
Otto
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveSheet.Name = Range("a2").Value
End Sub
"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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating Worksheet Names Tenaj Excel Worksheet Functions 16 January 13th 08 04:13 PM
The filter didn't show all (2,254) names when I set it up Darrell Excel Discussion (Misc queries) 2 December 17th 05 05:25 PM
Convert Local Names to Global Names Ed Excel Worksheet Functions 1 November 30th 05 06:23 PM
Visual Basics - Automating Specific Sheet Names Tenaj Excel Discussion (Misc queries) 9 October 6th 05 01:51 PM
sorting names alphabetically when names may start with numbers John Smith Excel Discussion (Misc queries) 3 May 11th 05 08:06 PM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"