Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default Name worksheet tab after cell data

Hi All

I am working on a new spreadsheet for work.
I want to be able to have the worksheet tabs rename themelves after data is
entered in a particular cell eg ("G9"). Also I would like this to work on all
worksheets created in the workbook so if I add more sheets to the book I will
be able to have each renamed to that particular cells data.
Also is there a way to have the sheet names displayed alphabetically and
updated if a sheet is renamed

Thanks for the help
--
crunchin numbers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Name worksheet tab after cell data

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, ActiveSheet.Range("G9")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value < "" Then
ActiveSheet.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

This is sheet event code that goes into Thisworkbook module so's it works on all
sheets.

Right-click the Excel Icon left of "File" on the menubar and "View Code". Paste
the above code into that module.

As far as sorting sheets, you could call Chip Pearson's sortworksheets macro
from the above after the End With

http://www.cpearson.com/excel/sortws.aspx


Gord Dibben MS Excel MVP

On Sun, 20 Apr 2008 21:44:01 -0700, belvy123
wrote:

Hi All

I am working on a new spreadsheet for work.
I want to be able to have the worksheet tabs rename themelves after data is
entered in a particular cell eg ("G9"). Also I would like this to work on all
worksheets created in the workbook so if I add more sheets to the book I will
be able to have each renamed to that particular cells data.
Also is there a way to have the sheet names displayed alphabetically and
updated if a sheet is renamed

Thanks for the help


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
Move cell data to another worksheet cell automatically. Alan New Users to Excel 3 April 6th 08 08:05 PM
Import data from 1 cell on 1 worksheet to othr cell(s) in another BCassedy Excel Worksheet Functions 1 July 19th 07 10:50 AM
How do I get data from a cell on another worksheet? Familyman Excel Worksheet Functions 3 June 26th 06 03:26 AM
copy data in a cell from worksheet A to worksheet B rajesh Excel Discussion (Misc queries) 1 February 21st 06 07:40 AM
Data From One Worksheet To Be Used In A Cell In A Different Worksheet ratt Excel Worksheet Functions 5 August 16th 05 03:13 AM


All times are GMT +1. The time now is 11:10 AM.

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

About Us

"It's about Microsoft Excel"