+ Reply to Thread
Results 1 to 2 of 2

Macro for naming sheets?

  1. #1
    Olle Svensson
    Guest

    Macro for naming sheets?

    I've just created a macro assigned to a button that creates a copy of a
    sheet. Now, I would like to add a line or two of code in that macro that
    changes the name of the newly created sheet to what is written in a cell on a
    different sheet.

    Is this in any way possible?

  2. #2
    Ron de Bruin
    Guest

    Re: Macro for naming sheets?

    Try this

    Sub test()
    ActiveSheet.Copy after:=Sheets(Sheets.Count)
    On Error Resume Next
    ActiveSheet.Name = Sheets("Sheet1").Range("A1").Value
    On Error GoTo 0
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Olle Svensson" <[email protected]> wrote in message news:[email protected]...
    > I've just created a macro assigned to a button that creates a copy of a
    > sheet. Now, I would like to add a line or two of code in that macro that
    > changes the name of the newly created sheet to what is written in a cell on a
    > different sheet.
    >
    > Is this in any way possible?




+ 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