A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Automatically update worksheet name



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2010, 09:52 PM posted to microsoft.public.excel.misc
JuneS
external usenet poster
 
Posts: 2
Default Automatically update worksheet name

Is there a way to change the names of worksheets automatically? I use Excel
2007 for invoicing, but it's really a pain to have to rename each sheet to
reflect my invoice number.

Is there a formula or solution for this?

Thanks!
  #2  
Old June 3rd, 2010, 10:25 PM posted to microsoft.public.excel.misc
Bob Phillips[_3_]
external usenet poster
 
Posts: 489
Default Automatically update worksheet name

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H5" '== change to cell with invoice number

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Me.Name = Target.Value
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

Bob

"JuneS" wrote in message
...
Is there a way to change the names of worksheets automatically? I use
Excel
2007 for invoicing, but it's really a pain to have to rename each sheet to
reflect my invoice number.

Is there a formula or solution for this?

Thanks!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:20 PM.


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