+ Reply to Thread
Results 1 to 11 of 11

Copy entire sheet, and name it according to a cell

  1. #1
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Copy entire sheet, and name it according to a cell

    Hi,

    I have one sheet named "week". I would appreciate a macro that copies it into a new sheet and name the new sheet according to the text in cell A10 and A11 (combined cell).

    Can someone please assist me?

    Gnoke
    Last edited by gnoke; 08-10-2010 at 09:38 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy entire sheet, and name it according to a cell

    Take a look at the Summary Sheet here, it contains code to do what you want
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Hi and thanks for your replay!

    I`ve looked at the summarysheet, but I can`t make it work with my code.
    I use this very simple code:

    Please Login or Register  to view this content.
    I would really like the copied sheet to be named according to the value in cell A11:A12, which is "January".

    Can you please write out my code?

    Gnoke

  4. #4
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Anyone else got an idea?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy entire sheet, and name it according to a cell

    Presumably, A11:A12 is a merged cells. Try
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Hi and thanks Roy

    You are right, they are merged cells.
    Thanks to you I was able to write out the following formula that nearly deos the trick:

    Please Login or Register  to view this content.
    The problem is only that it takes the name of the values in cell A10:A11 of the main sheet.
    I would like to name the sheet after the cellvalues in the "Copy sheet"

    Any suggestions?

    Gnoke

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy entire sheet, and name it according to a cell

    Are you changeing the cell value to the new name before copying?

    I've just realised that your cells are merged vertically so the cosde should be
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Runs smoothly
    One last issue however.
    Rows 14 - 23 are merged vertically and horizontaly from A - O as well and holds text. In the copied sheet, only the text from rows 14-15 are shown, the rest are blank.

    Any ideas why it is so?
    Last edited by gnoke; 08-02-2010 at 05:01 AM.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy entire sheet, and name it according to a cell

    possibly the cells contain more than 256 characters

  10. #10
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Again you are quite right.
    Is the a simple way to get around this issue, or do I have to live with it:P?

    Anyway, thanks a lot!
    Last edited by gnoke; 08-04-2010 at 02:54 AM.

  11. #11
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Copy entire sheet, and name it according to a cell

    Hi all,

    I am using the last code provided by royUK above.
    As written cells A11:O23 are merged an filled with text. However more then 256 characters are present.
    Anyone whi knows how to modify the code to get around this problem?

    Gnoke

    Duplicate:
    http://www.mrexcel.com/forum/showthread.php?t=486190
    Last edited by gnoke; 08-05-2010 at 03:45 AM. Reason: Duplicated due to no feedback

+ 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