Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2011, 02:13 AM
Nirik's Avatar
Nirik Nirik is offline change in the name of sheet accordingly Windows XP change in the name of sheet accordingly Office 2003
Smart Novice
change in the name of sheet accordingly
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default change in the name of sheet accordingly


Hii All,
Can the name of a sheet be changed according to the data in a particular cell automatically with the help of code or formula.

Thanks in @dvance.
Reply With Quote
  #2  
Old 11-02-2011, 03:08 AM
Catalin.B Catalin.B is offline change in the name of sheet accordingly Windows Vista change in the name of sheet accordingly Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

You can use this code in private module of the sheet:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)    
     
    If ActiveSheet.Range("C5").Value <> ActiveSheet.Name Then
      ActiveSheet.Name = ActiveSheet.Range("C5").Value
    End If
     
End Sub
Works only on Change event, means it does not run if a formula result changes, only after entering data in cells.
You can try changing to Worksheet_Activate
if you want to rename sheet based on this event...(will run when you open this sheet)
Reply With Quote
  #3  
Old 11-02-2011, 05:24 AM
Nirik's Avatar
Nirik Nirik is offline change in the name of sheet accordingly Windows XP change in the name of sheet accordingly Office 2003
Smart Novice
change in the name of sheet accordingly
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

i'm unable to get result based on ur code
i have entered data in cell c5 but the sheet name is not getting changed accordingly
Reply With Quote
  #4  
Old 11-02-2011, 06:43 AM
Catalin.B Catalin.B is offline change in the name of sheet accordingly Windows Vista change in the name of sheet accordingly Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Is the code placed in the private module of the sheet?
like in the sample attached?
I guess no..
Attached Files
File Type: xlsm rename sheet after cell value.xlsm (16.1 KB, 11 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
change in the name of sheet accordingly ensure I have an 8.5x11 sheet Taylor Word 3 10-09-2011 12:39 AM
change in the name of sheet accordingly How do I specify which sheet to save as PDF? shabbaranks Excel Programming 3 09-14-2011 09:19 PM
Reading Values from another sheet Raabi Excel 2 05-20-2011 02:14 AM
change in the name of sheet accordingly Delete sheet through VBA Salim Khan Excel 1 08-30-2010 09:11 AM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft