Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Automatically name all Sheet Tabs from a list

Can Someone help with this formula
This formula below will rename sheet tabs by coping the data from column A
What I would like it to do is to skip the header row A1 and then rename the
sheets starting from A2. Can this be done?

Sub NameSheets()

For sh = 1 To 15
Sheets(sh + 2).Name = Range("A" & sh).Value
Next sh

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Automatically name all Sheet Tabs from a list

The below will rename 2nd sheet onwards from Range A2-A16.

Sub NameSheets()

For sh = 1 To 15
Activeworkbook.Sheets(sh + 2).Name = Range("A" & sh+1)
Next sh

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

Can Someone help with this formula
This formula below will rename sheet tabs by coping the data from column A
What I would like it to do is to skip the header row A1 and then rename the
sheets starting from A2. Can this be done?

Sub NameSheets()

For sh = 1 To 15
Sheets(sh + 2).Name = Range("A" & sh).Value
Next sh

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Automatically name all Sheet Tabs from a list

Yes thats works beautifully

"Jacob Skaria" wrote:

The below will rename 2nd sheet onwards from Range A2-A16.

Sub NameSheets()

For sh = 1 To 15
Activeworkbook.Sheets(sh + 2).Name = Range("A" & sh+1)
Next sh

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

Can Someone help with this formula
This formula below will rename sheet tabs by coping the data from column A
What I would like it to do is to skip the header row A1 and then rename the
sheets starting from A2. Can this be done?

Sub NameSheets()

For sh = 1 To 15
Sheets(sh + 2).Name = Range("A" & sh).Value
Next sh

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Automatically name all Sheet Tabs from a list

It works beautifully
Thankyou very much.

"Jacob Skaria" wrote:

The below will rename 2nd sheet onwards from Range A2-A16.

Sub NameSheets()

For sh = 1 To 15
Activeworkbook.Sheets(sh + 2).Name = Range("A" & sh+1)
Next sh

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

Can Someone help with this formula
This formula below will rename sheet tabs by coping the data from column A
What I would like it to do is to skip the header row A1 and then rename the
sheets starting from A2. Can this be done?

Sub NameSheets()

For sh = 1 To 15
Sheets(sh + 2).Name = Range("A" & sh).Value
Next sh

End Sub

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Automatically name all Sheet Tabs from a list


Jacob - I had trouble w/ your code.

When I run your exact code on Excel 2007 I get "Run-Time error '9':
Subscript out of range.

I am a real rookie on this VBA code.
I also need to change the fixed-value of 15 to be the last column# in row 1
I use this code to find the last column number with data in row 1

' Holds last column number
' Range("A1").Select
' Range(Selection, Selection.End(xlToRight)).Select
' Selection.End(xlToRight).Select
' LastCol = ActiveCell.Column

I'd appreciate your help to insert worksheets with the names in A2:LastCol

--
Thanks for your reply & assistance.
Jimbo213


"Jacob Skaria" wrote:

The below will rename 2nd sheet onwards from Range A2-A16.

Sub NameSheets()

For sh = 1 To 15
Activeworkbook.Sheets(sh + 2).Name = Range("A" & sh+1)
Next sh

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"aussiegirlone" wrote:

Can Someone help with this formula
This formula below will rename sheet tabs by coping the data from column A
What I would like it to do is to skip the header row A1 and then rename the
sheets starting from A2. Can this be done?

Sub NameSheets()

For sh = 1 To 15
Sheets(sh + 2).Name = Range("A" & sh).Value
Next sh

End Sub

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
tabs are missing even though 'tools-options-view-sheet tabs' ok? rgranell Excel Worksheet Functions 3 August 16th 08 04:25 PM
Automatically create list in different sheet on basis of other lis Pair_of_Scissors[_2_] Excel Worksheet Functions 1 June 12th 08 05:59 PM
Automatically Name Tabs from List on Worksheet Named Team Cheri Excel Discussion (Misc queries) 10 April 12th 08 03:34 AM
Creating Sheet Tabs from a list PFLY Excel Discussion (Misc queries) 3 May 11th 07 06:10 PM
Name sheet tabs with a cell list deeds Excel Discussion (Misc queries) 2 June 9th 06 04:22 PM


All times are GMT +1. The time now is 09:05 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"