+ Reply to Thread
Results 1 to 5 of 5

VBA Create and Rename Sheets

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Create and Rename Sheets

    Hi, I wonder whether someone may be able to help me please.

    I'm using the code below to create a new worksheet for each line manager whose name appears in n column R of the "Unique Records" sheet.

    Please Login or Register  to view this content.
    The code works fine, but I'm having a little difficulty in changing one line of the code.

    Please Login or Register  to view this content.
    This line of code applies the 'Managers Name' to each sheet, but I'm looking to change this so the sheet name becomes "Activity Breakdown - 'Line Manager Name'"

    I've been able to change the line to

    Please Login or Register  to view this content.
    and each sheet name correctly displays the hyphen.

    But when I try to change the line to:

    Please Login or Register  to view this content.
    I receieve an error message.

    I just wondered whether someone could look at this please and offer some guidance on where I'm going wrong.

    Many thanks and kind regards
    Last edited by hobbiton73; 03-18-2014 at 06:29 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Create and Rename Sheets

    You might be breaking the limit for the no of characters you can have in a worksheet name.

    Off the top of my head that limit is 31/32 characters, and 'Activity Breakdown - ' already gives you 20 characters.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: VBA Create and Rename Sheets

    What is the error message?
    Click on the star if you think I helped you

  4. #4
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Create and Rename Sheets

    Hi @Norie, thank you for taking the time to reply to my post.

    I've continued to work on this since my post and ExcelForum added this to the site and you are quite correct, it was an issue with the number of characters.

    All the best and kind regards

  5. #5
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Create and Rename Sheets

    Hi @adyteo, thank you for taking the time to reply to my post.

    As you will see in my reply to @Norie, I've been able to resolve this issue.

    Many thanks and kind regards

+ 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. Create value then rename sheets based on value
    By ryan.johnson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2013, 06:42 AM
  2. Replies: 0
    Last Post: 07-16-2013, 01:20 PM
  3. Create and rename multiple sheets based on pivot-table field
    By Aerobane in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2013, 02:22 AM
  4. [SOLVED] Code to create new sheet and rename, regardless of any other sheets in workbook
    By csh8428 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2012, 02:22 PM
  5. Code to delete sheets and rename sheets in a protected workbook?
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-07-2011, 03:02 AM

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