Hello Friends, Welcome to dptutorials
In some of our Excel reports, we may want to name the sheets automatically according to the names on each sheet without manually renaming them.
So, in this tutorial, let us learn how we can automatically change Worksheet names based on Cell values using a small macro.
In this example, I am considering a sample report of 6 states in 6 sheets and let us rename these sheets with that of States names from cell B2 of each sheet.
Now, let us follow the step-by-step procedure
Step-1: Right click on any sheet and select view code or press Alt+F11 as a shortcut
Step2: Click on Insert from the menu bar, click on Module to insert a module
Copy the code
Sub RenameSheet() Dim rs As Worksheet For Each rs In Sheets rs.Name = rs.Range("B2") Next rs End Sub
And paste in this new module.
Step3: Close this VBA window and go back to your Excel workbook
Step4: Go to the view tab and under macros, click on view macros
Step5: After selecting the renamesheet macro, click on run
Step6: Now, you can see that the name of each sheet is renamed in accordance with the cell name on each sheet.
That's it friends. I hope this is very useful for those who spend a lot of time on Excel.
If you have enjoyed this tutorial, please do give me a like, share and also you can comment for improvement.
For further more interesting videos, please do subscribe dptutorials. Thanks for watching.
For Personalized detail learning, write to dptutorials15@gmail.com If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.
***************************************************************
Read my full article on this: http://ift.tt/2kB14dh
***************************************************************
Subscribe for more Awesome Tutorials: goo.gl/4T8ePc
***************************************************************
Support The Channel via shopping: http://ift.tt/2jH38PR
**************************************************************
You Can Connect With Me at
G+ : http://ift.tt/2kAOpa6
Twitter : https://twitter.com/dptutorials15
Facebook : http://ift.tt/2kfRnDi
Blogspot : http://ift.tt/2kB14dh
In some of our Excel reports, we may want to name the sheets automatically according to the names on each sheet without manually renaming them.
So, in this tutorial, let us learn how we can automatically change Worksheet names based on Cell values using a small macro.
In this example, I am considering a sample report of 6 states in 6 sheets and let us rename these sheets with that of States names from cell B2 of each sheet.
Now, let us follow the step-by-step procedure
Step-1: Right click on any sheet and select view code or press Alt+F11 as a shortcut
Step2: Click on Insert from the menu bar, click on Module to insert a module
Copy the code
Sub RenameSheet() Dim rs As Worksheet For Each rs In Sheets rs.Name = rs.Range("B2") Next rs End Sub
And paste in this new module.
Step3: Close this VBA window and go back to your Excel workbook
Step4: Go to the view tab and under macros, click on view macros
Step5: After selecting the renamesheet macro, click on run
Step6: Now, you can see that the name of each sheet is renamed in accordance with the cell name on each sheet.
That's it friends. I hope this is very useful for those who spend a lot of time on Excel.
If you have enjoyed this tutorial, please do give me a like, share and also you can comment for improvement.
For further more interesting videos, please do subscribe dptutorials. Thanks for watching.
For Personalized detail learning, write to dptutorials15@gmail.com If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.
***************************************************************
Read my full article on this: http://ift.tt/2kB14dh
***************************************************************
Subscribe for more Awesome Tutorials: goo.gl/4T8ePc
***************************************************************
Support The Channel via shopping: http://ift.tt/2jH38PR
**************************************************************
You Can Connect With Me at
G+ : http://ift.tt/2kAOpa6
Twitter : https://twitter.com/dptutorials15
Facebook : http://ift.tt/2kfRnDi
Blogspot : http://ift.tt/2kB14dh
Comments
Post a Comment