Calculations rename sheets

Rauday

New Member
Joined
Nov 5, 2005
Messages
4
I am looking for a piece of code etc that will rename the sheet() that the code resides in according to the value of a cell.

There are other code snipits on this board which work for macros...however if i have a sheet which calculates the cell and changes its value to say..."Profit" or "Loss" the sheet name changes automatically.

Example: SheetA has values which affect multiple other sheets (SheetB, SheetC. . .etc) I want SheetB to update and rename according to a value within a specific cell such as if $A$1 = "Profit" the sheet name would change to "Profit" . . and so on.

Note: I am going to modify your code to include my own text to concantenate to the resultant cell value so that i prevent redundant sheet names, so please do not program any error checking in your code...i need the code to be as simple as possible.
In other words....i know enough to keep each sheet unique, and i will concantenate the unique value to the cell value to create my new sheet name.

Thanks in advance to all who reply!



P.s. My observations thusfar indicate that this is without a doubt a well run forum with very knowledgable participants. Kudos to the forum staff and those who answer our <cough> sometimes idiotic <cough> questions.


My only negative comment is that the person(s) asking for help should be more specific with their scenarios and questions to make it easier for the knowledgable ones to reply.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Your post isn't particularly clear.

When do you want this name change to happen?

You mention other code on this board. Are you sure you didn't find anything that changed the sheet name using a worksheet event?
Code:
Private Sub Worksheet_Calculate()
    Me.Name = Me.Range("A1")
End Sub
 
Upvote 0
Action: I change a value in SheetA

Consequence:

SheetB automatically recalculates and if the value of cell $a$1 changes so too does the tab name


Thanks


Your posted code looks currect, it like you said a question of "When" to enact the code.

My personal limitation here...is i do not have a list of
when code get enacted

(i.e. on click, on refresh, on open etc)


Thanks !
 
Upvote 0

Forum statistics

Threads
1,203,236
Messages
6,054,298
Members
444,715
Latest member
GlitchHawk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top