Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Renaming Sheets automatically

Hi I know i posted this before but I unfortuantely had all my messages
removed from my connection,

Can I please have help

I am trying to rename the sheet on the tab to the name in cell a14

for example from sheet1 to xyz inc.

and I am not sure how private subs work

Thanks in advance once again

Tami


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Renaming Sheets automatically

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A14")) Is Nothing Then
With Target
Me.Name = .Value
End With
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 Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tami" wrote in message
...
Hi I know i posted this before but I unfortuantely had all my messages
removed from my connection,

Can I please have help

I am trying to rename the sheet on the tab to the name in cell a14

for example from sheet1 to xyz inc.

and I am not sure how private subs work

Thanks in advance once again

Tami




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Renaming Sheets automatically

Thankyou it works great

"Bob Phillips" wrote in message
...
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A14")) Is Nothing Then
With Target
Me.Name = .Value
End With
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 Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tami" wrote in message
...
Hi I know i posted this before but I unfortuantely had all my messages
removed from my connection,

Can I please have help

I am trying to rename the sheet on the tab to the name in cell a14

for example from sheet1 to xyz inc.

and I am not sure how private subs work

Thanks in advance once again

Tami






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
Renaming Sheets Accor Excel Discussion (Misc queries) 6 August 15th 08 04:43 PM
renaming all work-sheets at once Narendra Boga[_2_] Excel Discussion (Misc queries) 4 June 6th 07 03:24 AM
Renaming sheets Adri[_2_] Excel Programming 5 April 5th 04 10:09 PM
Renaming Sheets in a workbook Cameron MacRae Excel Programming 2 December 18th 03 11:19 PM
renaming sheets Jeremy Excel Programming 2 November 28th 03 04:46 PM


All times are GMT +1. The time now is 03:04 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"