Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: a macro to name a sheet as contents of cell a1.

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    n/a
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I had a look in your tips of the week and found this:

    Public Sub SaveAsA1()
    ThisFile = Range("A1").Value
    ActiveWorkbook.SaveAs Filename:=ThisFile
    End Sub

    but this names the workbook and not the sheet. I suppose there is a code to name the 'sheet' also, possibly? does anyone know what it is or how to record the macro. thanks to anyone who has the answer. chiao
    dj_dafad

    [ This Message was edited by: dj_dafad on 2002-04-11 07:16 ]

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    363
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this:

    Sub RenameSheets()
    Dim sht As Worksheet
    For Each sht In Worksheets
    sht.Name = sht.Cells(1, 1).Value
    Next
    End Sub


    It's never too late to learn something new.

    Ricky

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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