Its working.. For those having "Name already taken issues" - its because the cell specified in the code have the same values in all the worksheets. You need to have a unique value in the cell(the cell for naming your worksheet tab) or you need to change the cell address in the code itself
Yes this is the issue. Need a way for the code to append subsequent tabs with "(2)", "(3)", "(4)", "(5)", etc. as Excel does when copying tabs. Can this be built into the code?
Cool tip. Thanks. Just one thing I found out: If the reference cell is empty I get Run-time error `1004´: Method `Name`of object`_Worksheet`failed. To avoid it add an if statement: So the code looks like: Sub RenameSheet () Dim rs As Worksheet For Each rs in Sheets If rs.Range("A1")"" Then rs.Name=rs.Range("A1") End If Next rs End sub I then created a button and assigned the macro to it. Cheers
I want tabs to automatically be named as soon as I create it. I replace tabs with other tabs often and want the new tabs to automatically be given the name of a cell. I do not want to have to 'rightclick-> View Code -> insert Code etc.' every time I replace a tab.
It works only if the name is letters but when you have numbers as well it won't work. How can change formula so it will show date as sheet name? Thanks
Hello brother i want the people's names to be automatically entered in the right cell when i enter their number in the left cell so i don't have to type the name and number every time
Thanks for the video, very useful, is there a macro to be used if the contents of the cell (in this case B2) contains a formula that refers to a summary worksheet??
I am trying to do this on a MacBook and have ran into the error "Variable uses an Automation type not supported in Visual Basic" tried to follow other online tutorials but no luck. Any suggestions
I am getting an error (Run-Time "1004":). I believe that it refers to the formula in the cell that I would like the sheet to be named after. Is there a macro to name the sheet after the formula output?
Hello Sir, Can you please help me I have day wise data in Google spreadsheet all sheets names are saved as dates..can you please help me how take sheet name in cell reference using vlookup importrange function in spreadsheet ?
This is very informative and helpful. Thank you! How do i change the worksheet names based on 2 x different cells? I tried to modify the code to the following: rs.Name = rs.Range("B2", "C2") I kept getting error messages with this...
Great suggestion!, You can change the macro as, This will work now. Sub RenameSheet() Dim rs As Worksheet For Each rs In Sheets rs.Name = rs.Range("b2") & rs.Range("c2") Next rs End Sub
Is there a way to edit the macro so sheet names will automatically update from a range of cell values from one sheet rather than from the same cell on different sheets?
Yep. there is. In this example the list starts in line 6 of column A. if you start in line 1, then juts put i = 1. Sub RenameSheetsLIST() Dim i As Integer i = 6 For Each Sheet In Sheets If Cells(i, 1) "" Then Sheet.Name = Cells(i, 1).Value i = i + 1 End If Next Sheet End Sub Cheers
Big thanks to this tutorial sir, but how about if i am going to automatically rename worksheets from a nonidentical worksheet cell location listed in from a separate workbook? like references from cells B1, B3 downwards in a separate workbook? how to modify the "Sub RenameSheet() Dim rs As Worksheet For Each rs In Sheets rs.Name = rs.Range("B2") Next rs End Sub" code?
Hi, Thanks for the compliment, would definitely think over the problem and post a video soon. I welcome you to subscribe to this channel to enjoy more interesting videos.
Muhamed, not sure if this response is much too late, but if you don't mind doing it manually for a few sheets, you can follow the instructions in the video, but apply the following code on each sheet: Sub myTabName() ActiveSheet.Name = ActiveSheet.Range("A1") End Sub Just change A1 to whatever cell you're incorporating. I'm not an expert, but hope this helps!
@@jeremyh.1243 Please see my reply to Muhamed's post. Probably doesn't matter a month later, but in case you're still looking for an answer, I hope this helps!
Sub RenameSheet() Dim rs As Worksheet For Each rs In Sheets rs.Name = rs.Range("B8") Next rs End Sub Do you allow to rename to merge cell or not allowed? thanks
@@dptutorials Thank you so much for prompt reply. I realised the macro only works well for TEXT. It doest not work for FORMULA and DATE. The cell value should only be TEXT. If it is FORMULA or DATE, the macro doesn't work. Do you have macro that can be linked to cell that contains date and formula? thanks.
What if I have a list of names on one sheet and I want to tie a different sheet to the cell in another sheet? Basically, one sheet has January February March etc on it... Instead I want to specify each sheet to pull a name from a specific cell on another sheet?
I found this extremely helpful thankyou
Glad it helped
Its working.. For those having "Name already taken issues" - its because the cell specified in the code have the same values in all the worksheets. You need to have a unique value in the cell(the cell for naming your worksheet tab) or you need to change the cell address in the code itself
Yes this is the issue. Need a way for the code to append subsequent tabs with "(2)", "(3)", "(4)", "(5)", etc. as Excel does when copying tabs. Can this be built into the code?
I had to use sheets for monthly data. Helps a lot the automation!!
hello!
really helpful!
if you want to change only one sheet?
Cool tip. Thanks. Just one thing I found out: If the reference cell is empty I get Run-time error `1004´: Method `Name`of object`_Worksheet`failed. To avoid it add an if statement: So the code looks like:
Sub RenameSheet ()
Dim rs As Worksheet
For Each rs in Sheets
If rs.Range("A1")"" Then
rs.Name=rs.Range("A1")
End If
Next rs
End sub
I then created a button and assigned the macro to it.
Cheers
Great tip! Thanks for sharing.
Thank you for sharing this!
Thanks...With your change it worked :)))
Thank you for sharing such a useful task. 👍
Sir, i have a query, How to change/move specific cell value on the base of drop-down list.
Most welcome
Thank you works perfect. How to edit macro to contain sheets name from two cells?
I want tabs to automatically be named as soon as I create it. I replace tabs with other tabs often and want the new tabs to automatically be given the name of a cell.
I do not want to have to 'rightclick-> View Code -> insert Code etc.' every time I replace a tab.
for me this line says error
"rs.Name = rs.Range("B2")"
you find a fix?
Really helpful my gdness
Glad it helped
Thank you ❤
Welcome
not applicable in my excel sheet error as below
Run-time error'424': object required, please reply
Thank You So Mutch.
Always welcome
But what if you want to rename some specific sheets based on cell value if they contain text ?
This is so close to what I'm trying to do.
That is so nice
It works only if the name is letters but when you have numbers as well it won't work. How can change formula so it will show date as sheet name? Thanks
Hello brother i want the people's names to be automatically entered in the right cell when i enter their number in the left cell so i don't have to type the name and number every time
Thanks for the video. It was really helpful. Could you let me know how can I rename the "Workbook" according to the cell value?
please find the video for the asked question. ua-cam.com/video/GSwnQkRB01Q/v-deo.html
Thanks for the video, very useful, is there a macro to be used if the contents of the cell (in this case B2) contains a formula that refers to a summary worksheet??
Yes, absolutely
i want to rename all my worksheets except the 1st one how do i code that
This is nice but would be better if you broke down the VBA Code so that we don't have to copy your code but can write our own.
Perfect. Thank you sir
So nice of you
Can you perform this in Google Sheet? Thanks in advance.
many thanks, very helpful brother..
Thanks a lot for the feedback.
I welcome you to subscribe this channel to enjoy more interesting videos.
thanks alot, how can you rename a worksheet and automatically save to the workbook bar below
Most welcome
How do you get this macro to run automatically when the cell data changes? Thank you.
Thanks a lot for the comment. This would be useful for first saving. Need to modify the macro for resaving.
I welcome you to subscribe to the channel.
Works perfect. Thank you ver much
Thanks a lot.
I welcome you to subscribe to the channel.
Hi please help, I want to rename all sheets using it except the first sheet.
Could you write it for me?
Thank you .
You are welcome!
I am trying to do this on a MacBook and have ran into the error "Variable uses an Automation type not supported in Visual Basic" tried to follow other online tutorials but no luck. Any suggestions
I have a list of names in one sheet. I want to produce sheets that get the name from that list. How can I do that?
Will surely post a video on this.
Rename sheet on google spreadsheet from range use app script, how ?
I want to create table coloumns based on cell values is there any way
Hi, Could you please write to info@dptutorials.com with small example as I did not get you question.
@@dptutorials I have sent you email.
I would like to trigger every time a tab is renamed looking for the previous name and update it to the new one.
I am getting an error (Run-Time "1004":). I believe that it refers to the formula in the cell that I would like the sheet to be named after.
Is there a macro to name the sheet after the formula output?
I had (Run-Time "1004":) error too, as I was trying to add dates, Excel wont allow special characters ie: " / " in a Tab title
Is there a way to do this without VBA or Macro? Thank you in advance.
No way please
Sir how about in Google sheet?
What if the State name are the same in two or more sheets? better if you can add AP(1)
THANK YOU SO MUCH. i got 1 problem, when i write the formula it doesnt show on my macro
can u please help me?
please send me your excel sheet at dptutorials15@gmail.com
Hello Sir, Can you please help me I have day wise data in Google spreadsheet all sheets names are saved as dates..can you please help me how take sheet name in cell reference using vlookup importrange function in spreadsheet ?
I did not get the question completely. Do you want the list of sheet names as index in one sheet?
This is very informative and helpful. Thank you!
How do i change the worksheet names based on 2 x different cells?
I tried to modify the code to the following:
rs.Name = rs.Range("B2", "C2")
I kept getting error messages with this...
Great suggestion!, You can change the macro as, This will work now.
Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("b2") & rs.Range("c2")
Next rs
End Sub
I am getting error while running the macros. Run time error 1004. Method name of object_worksheet failed, any solution
Same here
Can we extract sheet name in IF formula ?
Yes its possible using the Get.workbook and index formula
How we can do the same in Google sheet
Is there a way to edit the macro so sheet names will automatically update from a range of cell values from one sheet rather than from the same cell on different sheets?
Yep. there is. In this example the list starts in line 6 of column A. if you start in line 1, then juts put i = 1.
Sub RenameSheetsLIST()
Dim i As Integer
i = 6
For Each Sheet In Sheets
If Cells(i, 1) "" Then
Sheet.Name = Cells(i, 1).Value
i = i + 1
End If
Next Sheet
End Sub
Cheers
Hi , i want to change the sheets name to the name i type on a particular colunm on another sheet. can some one help.
Let me check
Great solution, but how can I skip a worksheet naming if the "B2" cell is blank and continue with the next?
name of B2 is more than 31 character , there is an error, how to solve?
Big thanks to this tutorial sir, but how about if i am going to automatically rename worksheets from a nonidentical worksheet cell location listed in from a separate workbook? like references from cells B1, B3 downwards in a separate workbook? how to modify the
"Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("B2")
Next rs
End Sub"
code?
Hi, Thanks for the compliment, would definitely think over the problem and post a video soon.
I welcome you to subscribe to this channel to enjoy more interesting videos.
hi I want same method in google sheet. How it?
Please make a google script code
Sure, let me check.
@@dptutorials okay I am Waiting your video
Instead of renaming all the sheets, how can I rename few selected sheets based on cell value ?
Will need to check on this.
@dptutorials any updates?
Muhamed, not sure if this response is much too late, but if you don't mind doing it manually for a few sheets, you can follow the instructions in the video, but apply the following code on each sheet:
Sub myTabName()
ActiveSheet.Name = ActiveSheet.Range("A1")
End Sub
Just change A1 to whatever cell you're incorporating. I'm not an expert, but hope this helps!
@@jeremyh.1243 Please see my reply to Muhamed's post. Probably doesn't matter a month later, but in case you're still looking for an answer, I hope this helps!
@@MixedEmotions_00 Tank you! I will give this a try. Just in time. :)
Can you make it automatically update every time the cell is changed rather than having to run the macro?
Will try for sure.
Thanks a lot for the feedback.
I welcome you to subscribe to this channel to enjoy more interesting videos.
Hello, I tried out but it did not work. It has error message, debug. can you help? thanks.
Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("B8")
Next rs
End Sub
Do you allow to rename to merge cell or not allowed? thanks
It works mostly with the unmerged cells, try it once. If not please send me the excel sheet to dptutorials15@gmail.com
@@dptutorials Thank you so much for prompt reply. I realised the macro only works well for TEXT. It doest not work for FORMULA and DATE. The cell value should only be TEXT. If it is FORMULA or DATE, the macro doesn't work. Do you have macro that can be linked to cell that contains date and formula? thanks.
Do you have a video on how to do this in Google Sheets?
Hey, I have not explored much on google sheets.
Not being able to find the link
Mentioned now, Thanks for highlighting
I AM AGAIN AND AGAIN GETTING THIS ERROR
"THE NAME IS ALREADY TAKEN TRY A DIFFERENT ONE"
code is getting error not accepted
NOT WORKING.. SHOWING A ERROR.
Not working on 365
There is no code in description
Mentioned now, Thanks for highlighting
👏👏👏👏👏
👍👍👍👍👍
Thanks a lot for the feedback.
I welcome you to subscribe to this channel to enjoy more interesting videos
What if I have a list of names on one sheet and I want to tie a different sheet to the cell in another sheet?
Basically, one sheet has January February March etc on it... Instead I want to specify each sheet to pull a name from a specific cell on another sheet?
This can be done.