+ Reply to Thread
Results 1 to 3 of 3

Automatically naming sheets

  1. #1
    Registered User
    Join Date
    07-16-2004
    Posts
    56

    Automatically naming sheets

    I have a list of names in Sheet1.range("a1:z1"). I want each sheet to be named after a different name in the list. For example, I want sheet2.name to be sheet1.range("a1"). Is there any quick way to automate this.
    Thanks,

  2. #2
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479
    Quote Originally Posted by ForSale
    I have a list of names in Sheet1.range("a1:z1"). I want each sheet to be named after a different name in the list. For example, I want sheet2.name to be sheet1.range("a1"). Is there any quick way to automate this.
    Thanks,
    Hi Forsale

    You can use this macro

    Sub update_all_names()
    For Each sh In ActiveWorkbook.Sheets
    sh.Activate
    sh.Name = Cells(1, 1).Value
    Next sh
    End Sub
    Paul

  3. #3
    JE McGimpsey
    Guest

    Re: Automatically naming sheets

    One way:

    Dim i As Long
    On Error Resume Next ' in case invalid or duplicate name
    For i = 2 To Worksheets.Count
    Worksheets(i).Name = Sheet1.Cells(1, i - 1).Text
    Next i
    On Error GoTo 0



    In article <[email protected]>,
    ForSale <[email protected]> wrote:

    > I have a list of names in Sheet1.range("a1:z1"). I want each sheet to
    > be named after a different name in the list. For example, I want
    > sheet2.name to be sheet1.range("a1"). Is there any quick way to
    > automate this.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1