Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Creating a macro to name several tabs
I have this macro:
Sub Macro() Sheets(1).Name = Range("b1").Value Range("B17").Select End Sub and it works in renaming the tab to whatever is in cell "B1" but I have 30+ tabs that I need to run this for and I can't figure out the rest of the macro needed for this to go thru all of the tabs and not just the first one. Any help would be appreciated! Thanks |
#2
|
|||
|
|||
Creating a macro to name several tabs
Try:
Sub macro() Dim i As Integer On Error Resume Next For i = 1 To Sheets.Count Sheets(i).Name = Sheets(i).Range("B1").Value Next i On Error GoTo 0 End Sub Hope this helps Rowan BitsofColour wrote: I have this macro: Sub Macro() Sheets(1).Name = Range("b1").Value Range("B17").Select End Sub and it works in renaming the tab to whatever is in cell "B1" but I have 30+ tabs that I need to run this for and I can't figure out the rest of the macro needed for this to go thru all of the tabs and not just the first one. Any help would be appreciated! Thanks |
#3
|
|||
|
|||
Creating a macro to name several tabs
Thank you - that works great!
"BitsofColour" wrote: I have this macro: Sub Macro() Sheets(1).Name = Range("b1").Value Range("B17").Select End Sub and it works in renaming the tab to whatever is in cell "B1" but I have 30+ tabs that I need to run this for and I can't figure out the rest of the macro needed for this to go thru all of the tabs and not just the first one. Any help would be appreciated! Thanks |
#4
|
|||
|
|||
Creating a macro to name several tabs
You're welcome.
BitsofColour wrote: Thank you - that works great! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Macro Creating | New Users to Excel | |||
Creating a macro to save only partial data | Excel Discussion (Misc queries) | |||
Creating a macro in excel | Excel Worksheet Functions | |||
Creating a macro | Excel Worksheet Functions |