LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Automatically naming sheets

In cell c4 i have a link to a cell in another sheet
In cell c5 i have the formula ="OF_"&C4.
How do I get excel to automatically rename the sheet to the content i C5.
I have tried right click the sheet and select 'view code' and pasted:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error Resume Next
With Target
If .Address = "$A$1" Then
Me.Name = .Value
End If
End With
Application.EnableEvents = True
End Sub

into it.
It seems that this macro only works when you enter the text manually into
the cell c5 i.e. it is not automatically updated when I change the content of
the cell which c4 refers to.
Any ideas?

Also, will there be a problem when I protect the sheet and the cell C5 has
the format 'locked', and if so can I get around that without having to unlock
the cell.
Thanks
/Adam
 
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
Automatically naming and linking controls Blue Max Excel Worksheet Functions 6 December 16th 08 06:04 AM
VBA Help naming sheets jlclyde Excel Discussion (Misc queries) 8 November 20th 07 09:59 PM
naming a sheet automatically terry freedman Excel Programming 8 January 25th 05 04:39 PM
Automatically naming a tab jga Excel Discussion (Misc queries) 1 December 21st 04 03:30 PM
Automatically naming a worksheet tab with dates? Dick Kusleika[_2_] Excel Programming 1 September 6th 03 02:57 AM


All times are GMT +1. The time now is 04:19 PM.

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"