Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
BitsofColour
 
Posts: n/a
Default 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   Report Post  
Rowan Drummond
 
Posts: n/a
Default 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   Report Post  
BitsofColour
 
Posts: n/a
Default 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   Report Post  
Rowan Drummond
 
Posts: n/a
Default Creating a macro to name several tabs

You're welcome.

BitsofColour wrote:
Thank you - that works great!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Macro Creating Duster142 New Users to Excel 2 October 7th 05 01:50 AM
Creating a macro to save only partial data Jparsons Excel Discussion (Misc queries) 0 September 24th 05 10:50 AM
Creating a macro in excel Not sure what I am doing Excel Worksheet Functions 1 March 25th 05 11:04 PM
Creating a macro Macro Insite Excel Worksheet Functions 3 November 25th 04 11:08 PM


All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"