Code for tab name from a cell of a different worksheet in same workbook

mckeamic

New Member
Joined
Nov 26, 2018
Messages
20
Good Evening,
I have been struggling with this macro code for a few days now and was hoping I can find the answers here.

I am a zookeeper (birds) and we are changing our Incubator room process to all digital (there is a spreadsheet we use for basic data "egg measurements, parameters for the machine like temperature & humidity, and pre-entered formulas to calculate weight loss...it all differs based on species) we then hand write on the sheet after it has been printed and it then goes into a binder....
Will try not to get too off track, but: I have a "DATA" sheet where most of my info will be entered and certain information will transfer to an individual sheet (each egg will have its own individual sheet)....

My question is: on the main worksheet "DATA" (where all my info is typed in) I need cell "B5" (which I will type in the egg log # it is assigned (i.e. B11-26-8) and I need it to transfer to the tab name of the individual egg sheet.

I found a code that allowed me to type (the egg log #) in cell "D7" of the actual individual egg worksheet and it would change the tab name at the bottom. (I also unfortunately lost that code and can't seem to find it through google. Which was somewhat helpful, but not exactly what I was looking for.

Any help would be much appreciated. Let me know if anyone has any questions in case I made this not very understandable, lol.
Thanks again
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Im afraid what you have written there is far too vague and will be why after quite a few hours you havent had a reply. Always try to keep in mind we cant see your workbook. You have to give examples of what you have and what you attempt to do. It doesnt sound to me like you are going about it the right way but like i say i cant be sure as im struggling to visualise your set up.
 
Upvote 0
Sorry, was worried I wasn't going to be able to explain it correctly. Let me try again.
On my workbook I have a worksheet labeled "DATA", where all the main info is inputted in. (i.e. egg log #, species name, length, width, weight, incubation period, etc...)
There is an individual worksheet for each egg that we receive {on a given year we have anywhere from 200-500 eggs, so there will be a "DATA" worksheet & 200-500 worksheets (one for each egg) (on each individual tab has the progress and all the formulas to track the progress of the egg). The information inputted in "DATA" worksheet will automatically transfer to the corresponding worksheet for that specific individual egg.
***What I need is a code for the tab name of the individual (egg) worksheet that will auto populate the egg log number it is assigned when it is entered in a cell (B5) on the main "DATA" worksheet.
<I did find a code that changes the tab name when data was entered in a cell on the same page itself>, but I need it to come from a different worksheet on the same workbook.

I hope this was a little more helpful and I can get some advise on this.
Thank You
 
Upvote 0
Sorry, it cut off part of my message:

***What I need is a code for the tab name of the individual (egg) worksheet that will auto populate the egg log number it is assigned when it is entered in a cell (B5) on the main "DATA" worksheet.
I did find a code that changes the tab name of the individual egg worksheet from info that was entered on the individual egg worksheet, but I need it to come from a different worksheet "DATA" on the same workbook.
 
Upvote 0
I also looked at this question yesterday and did no feel like you provided specific details.

Like you said:
The information inputted in "DATA" worksheet will automatically transfer to the corresponding worksheet for that specific individual egg.

What information was entered on the data sheet??
Do we need to copy the whole row?
And where on the other sheet is it pasted?
Do we copy the whole row and paste it into the first empty row on the other sheet?

Assuming each row has data in column A we look down column A till the first empty cell in column A

See these are specific details we need.

And you said:
worksheet that will auto populate the egg log number it is assigned when it is entered in a cell (B5)

So you want the script to run automatically when you enter a sheet name in B5 is that what you want.

And it will always be B5?
<strike>
</strike>
 
Upvote 0
Ok, let me try to simplify this a little.
For worksheet "B" I need the tab name to change on what I type in cell "B5" on worksheet "A"

There is a code I found that changes the tab name for worksheet "B" but from cell "B5" on worksheet "B".
I just can't find that original code to give everyone to help me a little further in the right direction.

And I don't know how to attach pictures on here to help explain it better.

Thanks,
Michelle
 
Upvote 0
OK put this script in sheet name "A"
When You enter a value in "B5" sheet named "B"
will now be named the value you entered into "B5" on sheet named 'A"

But now this will only work once because you will no longer have a sheet named "B"

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  11/27/2018  4:37:31 PM  EST
If Not Intersect(Target, Range("B5")) Is Nothing Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Sheets("B").Name = Target.Value
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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