Automatically Change Worksheet Names Based On Cell Values || Rename Excel sheet with cell contents

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 111

  • @jdsteel61
    @jdsteel61 4 роки тому +5

    I found this extremely helpful thankyou

  • @bda2317
    @bda2317 5 років тому +4

    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

    • @danielgerstenberger6411
      @danielgerstenberger6411 4 роки тому

      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?

  • @heyitsjujuu
    @heyitsjujuu Рік тому +1

    I had to use sheets for monthly data. Helps a lot the automation!!

  • @johnkosmidis5794
    @johnkosmidis5794 2 місяці тому

    hello!
    really helpful!
    if you want to change only one sheet?

  • @nairobi203
    @nairobi203 3 роки тому +10

    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

    • @dptutorials
      @dptutorials  3 роки тому +1

      Great tip! Thanks for sharing.

    • @ahuber
      @ahuber Рік тому

      Thank you for sharing this!

    • @idimeci980
      @idimeci980 26 днів тому

      Thanks...With your change it worked :)))

  • @Sami-Ur-Rehman-Blogger
    @Sami-Ur-Rehman-Blogger Рік тому +1

    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.

  • @arturasjankauskas7582
    @arturasjankauskas7582 5 років тому +2

    Thank you works perfect. How to edit macro to contain sheets name from two cells?

  • @baden271
    @baden271 2 роки тому +5

    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.

  • @albertwilson3396
    @albertwilson3396 2 роки тому +11

    for me this line says error
    "rs.Name = rs.Range("B2")"

  • @LamLam-ln5qx
    @LamLam-ln5qx 3 роки тому +1

    Really helpful my gdness

  • @gkadhikari736
    @gkadhikari736 Рік тому +1

    Thank you ❤

  • @hajiso786
    @hajiso786 3 роки тому +2

    not applicable in my excel sheet error as below
    Run-time error'424': object required, please reply

  • @MohAboAbdo
    @MohAboAbdo 4 роки тому +1

    Thank You So Mutch.

  • @SalAbraham7
    @SalAbraham7 5 років тому +2

    But what if you want to rename some specific sheets based on cell value if they contain text ?

  • @Slyrouth
    @Slyrouth 3 роки тому +1

    This is so close to what I'm trying to do.

  • @Zrzmovies
    @Zrzmovies Рік тому +1

    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

  • @savvy_me
    @savvy_me Рік тому +1

    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

  • @manoshikadamunugolla5900
    @manoshikadamunugolla5900 3 роки тому

    Thanks for the video. It was really helpful. Could you let me know how can I rename the "Workbook" according to the cell value?

    • @dptutorials
      @dptutorials  3 роки тому

      please find the video for the asked question. ua-cam.com/video/GSwnQkRB01Q/v-deo.html

  • @yosibest
    @yosibest 3 роки тому

    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??

  • @jamalakeembasdeo454
    @jamalakeembasdeo454 4 роки тому +2

    i want to rename all my worksheets except the 1st one how do i code that

  • @marceljunioregondi5594
    @marceljunioregondi5594 2 роки тому +1

    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.

  • @2409shrikant
    @2409shrikant 4 роки тому

    Perfect. Thank you sir

  • @PeiPeiSiau-Cronin
    @PeiPeiSiau-Cronin 8 місяців тому

    Can you perform this in Google Sheet? Thanks in advance.

  • @mauricelee2219
    @mauricelee2219 5 років тому

    many thanks, very helpful brother..

    • @dptutorials
      @dptutorials  5 років тому

      Thanks a lot for the feedback.
      I welcome you to subscribe this channel to enjoy more interesting videos.

  • @gregorythompson8873
    @gregorythompson8873 2 роки тому

    thanks alot, how can you rename a worksheet and automatically save to the workbook bar below

  • @donnawinski931
    @donnawinski931 5 років тому +2

    How do you get this macro to run automatically when the cell data changes? Thank you.

    • @dptutorials
      @dptutorials  5 років тому +1

      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.

  • @TheRealAllForHockey
    @TheRealAllForHockey 5 років тому

    Works perfect. Thank you ver much

    • @dptutorials
      @dptutorials  5 років тому

      Thanks a lot.
      I welcome you to subscribe to the channel.

  • @legendsaud
    @legendsaud Рік тому

    Hi please help, I want to rename all sheets using it except the first sheet.
    Could you write it for me?

  • @MsOfficeLearning
    @MsOfficeLearning 3 роки тому

    Thank you .

  • @antonioaaron8055
    @antonioaaron8055 Рік тому

    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

  • @rasoulkhoshravan5912
    @rasoulkhoshravan5912 4 роки тому +1

    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?

    • @dptutorials
      @dptutorials  4 роки тому

      Will surely post a video on this.

  • @tanganhminh9138
    @tanganhminh9138 Рік тому

    Rename sheet on google spreadsheet from range use app script, how ?

  • @myimaanofficial
    @myimaanofficial 2 роки тому

    I want to create table coloumns based on cell values is there any way

    • @dptutorials
      @dptutorials  2 роки тому

      Hi, Could you please write to info@dptutorials.com with small example as I did not get you question.

    • @myimaanofficial
      @myimaanofficial 2 роки тому

      @@dptutorials I have sent you email.

  • @ezequiasrocha3037
    @ezequiasrocha3037 3 місяці тому

    I would like to trigger every time a tab is renamed looking for the previous name and update it to the new one.

  • @alisont8279
    @alisont8279 4 роки тому +1

    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?

    • @mrworldwide9641
      @mrworldwide9641 2 роки тому

      I had (Run-Time "1004":) error too, as I was trying to add dates, Excel wont allow special characters ie: " / " in a Tab title

  • @yokohamazoomer8614
    @yokohamazoomer8614 3 роки тому

    Is there a way to do this without VBA or Macro? Thank you in advance.

  • @sweetmask1690
    @sweetmask1690 7 місяців тому

    Sir how about in Google sheet?

  • @AileenGo-bf7kz
    @AileenGo-bf7kz Рік тому

    What if the State name are the same in two or more sheets? better if you can add AP(1)

  • @njoyathomastimond4441
    @njoyathomastimond4441 4 роки тому

    THANK YOU SO MUCH. i got 1 problem, when i write the formula it doesnt show on my macro
    can u please help me?

    • @dptutorials
      @dptutorials  4 роки тому

      please send me your excel sheet at dptutorials15@gmail.com

  • @NaveenKumar-sc9lq
    @NaveenKumar-sc9lq 3 роки тому

    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 ?

    • @dptutorials
      @dptutorials  3 роки тому

      I did not get the question completely. Do you want the list of sheet names as index in one sheet?

  • @pasqualex2
    @pasqualex2 4 роки тому

    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...

    • @dptutorials
      @dptutorials  4 роки тому +2

      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

  • @ronnyrockfreak
    @ronnyrockfreak 5 років тому +6

    I am getting error while running the macros. Run time error 1004. Method name of object_worksheet failed, any solution

  • @kishorkulkarni4120
    @kishorkulkarni4120 2 роки тому

    Can we extract sheet name in IF formula ?

    • @dptutorials
      @dptutorials  2 роки тому +1

      Yes its possible using the Get.workbook and index formula

  • @nikunj84233
    @nikunj84233 5 місяців тому

    How we can do the same in Google sheet

  • @kaceyfoust8632
    @kaceyfoust8632 5 років тому

    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?

    • @nairobi203
      @nairobi203 3 роки тому +1

      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

  • @prathu123
    @prathu123 3 роки тому

    Hi , i want to change the sheets name to the name i type on a particular colunm on another sheet. can some one help.

  • @Bladeshooked_Daniel
    @Bladeshooked_Daniel 4 роки тому

    Great solution, but how can I skip a worksheet naming if the "B2" cell is blank and continue with the next?

  • @盈谚陈
    @盈谚陈 8 місяців тому

    name of B2 is more than 31 character , there is an error, how to solve?

  • @michaelmiranda3589
    @michaelmiranda3589 5 років тому

    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?

    • @dptutorials
      @dptutorials  5 років тому

      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.

  • @sajidshahzad7995
    @sajidshahzad7995 2 роки тому

    hi I want same method in google sheet. How it?
    Please make a google script code

  • @rafeek4u
    @rafeek4u 4 роки тому +1

    Instead of renaming all the sheets, how can I rename few selected sheets based on cell value ?

    • @dptutorials
      @dptutorials  4 роки тому +1

      Will need to check on this.

    • @jeremyh.1243
      @jeremyh.1243 4 роки тому

      @dptutorials any updates?

    • @MixedEmotions_00
      @MixedEmotions_00 4 роки тому

      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!

    • @MixedEmotions_00
      @MixedEmotions_00 4 роки тому

      @@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!

    • @jeremyh.1243
      @jeremyh.1243 4 роки тому

      @@MixedEmotions_00 Tank you! I will give this a try. Just in time. :)

  • @matthewzicher1924
    @matthewzicher1924 4 роки тому

    Can you make it automatically update every time the cell is changed rather than having to run the macro?

    • @dptutorials
      @dptutorials  4 роки тому

      Will try for sure.
      Thanks a lot for the feedback.
      I welcome you to subscribe to this channel to enjoy more interesting videos.

  • @shintanarulita4733
    @shintanarulita4733 4 роки тому

    Hello, I tried out but it did not work. It has error message, debug. can you help? thanks.

    • @shintanarulita4733
      @shintanarulita4733 4 роки тому

      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
      @dptutorials  4 роки тому +1

      It works mostly with the unmerged cells, try it once. If not please send me the excel sheet to dptutorials15@gmail.com

    • @shintanarulita4733
      @shintanarulita4733 4 роки тому

      @@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.

  • @landersfamilychiro
    @landersfamilychiro 4 роки тому

    Do you have a video on how to do this in Google Sheets?

    • @dptutorials
      @dptutorials  4 роки тому

      Hey, I have not explored much on google sheets.

  • @harshgoyal393
    @harshgoyal393 3 роки тому

    Not being able to find the link

    • @dptutorials
      @dptutorials  3 роки тому

      Mentioned now, Thanks for highlighting

  • @sudharsaneaswaran2516
    @sudharsaneaswaran2516 5 років тому +1

    I AM AGAIN AND AGAIN GETTING THIS ERROR
    "THE NAME IS ALREADY TAKEN TRY A DIFFERENT ONE"

  • @rupam6746
    @rupam6746 4 роки тому

    code is getting error not accepted

  • @md.alamin9342
    @md.alamin9342 5 років тому +1

    NOT WORKING.. SHOWING A ERROR.

  • @haiderkhalilebrahimsalman1961
    @haiderkhalilebrahimsalman1961 2 роки тому

    Not working on 365

  • @davidpaul7603
    @davidpaul7603 3 роки тому

    There is no code in description

    • @dptutorials
      @dptutorials  3 роки тому

      Mentioned now, Thanks for highlighting

  • @jsfbr
    @jsfbr 4 роки тому +1

    👏👏👏👏👏
    👍👍👍👍👍

    • @dptutorials
      @dptutorials  4 роки тому

      Thanks a lot for the feedback.
      I welcome you to subscribe to this channel to enjoy more interesting videos

  • @onedaytonwomandotcom
    @onedaytonwomandotcom Рік тому +1

    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?