Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel is there a way to automatically rename the sheet after a cell? 1

Status
Not open for further replies.

RITec

MIS
May 15, 2002
98
US
Hi

Excel Question

I was wondering if there was a way in Excel to rename the sheet after the contents in a cell (automatically)?

Example Cell A2 contains the word "Links" is there a way to rename the Sheet (automatically) to match Cell A2 without haveing to manually rename the sheet?
 
Enable macros.....Tools>Macro>security (choose low)

Paste this in the worksheet change event....

(right click on sheet name)...choose view code,
in the 1st drop down, change "general" to worksheet,...in the 2nd drop down choose "change"


paste the if statement from below into the event sub...


'_______________________________


Private Sub Worksheet_Change(ByVal Target As Range)

If Range(&quot;a2&quot;) <> &quot;&quot; Then ActiveSheet.Name = Range(&quot;A2&quot;)

End Sub
 
Hi ETID

Thanks that was exactly what I wanted
[2thumbsup]

Thank You

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top