+ Reply to Thread
Results 1 to 3 of 3

Rename sheet with contents from 2 cells

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    54

    Rename sheet with contents from 2 cells

    Hello there,

    I am trying to rename my worksheets based on the contents from 2 cells.
    I have the following macro which renames based on 1 cell but i can't seem to get the range to work for two.

    Sub RenameSheet()

    Dim rs As Worksheet

    For Each rs In Sheets
    rs.Name = rs.Range("A1")
    Next rs

    End Sub



    All help is much appreciated.
    Thanks

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Rename sheet with contents from 2 cells

    Hello, please post code in
    Please Login or Register  to view this content.
    Also note that: to avoid errors, there are certain limitations to what a sheet name can be. i.e. not more than 31 characters, cannot contain certain special characters, etc. You can manually rename the sheet name, delete it and press enter. Excel will prompt with an error message showing the limitations.
    Last edited by millz; 12-11-2013 at 06:05 AM.

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Rename sheet with contents from 2 cells

    Brilliant, works perfectly.

    Thank you kindly millz.

    P.S I will post all code in [code] tags from now on

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 07-16-2013, 01:20 PM
  2. Object Error, Merge cells and Sheet rename.
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2011, 04:39 AM
  3. copy sheet to new sheet, rename it, return cell contents
    By soldstatic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2009, 01:49 PM
  4. How to copy a sheet and rename it with the value of two cells from the source sheet?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2006, 08:31 PM
  5. Rename active sheet to contents of specific cell
    By burl_rfc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2006, 07:40 PM

Tags for this Thread

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