+ Reply to Thread
Results 1 to 3 of 3

Worksheet Naming

  1. #1
    Registered User
    Join Date
    06-28-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Worksheet Naming

    I'd like to preface the post with big thanks ahead of time. You guys are great for using your own spare time to help people out I've been reading for a while to get help on various Excel problems, and I've learned a lot about macros and VBA. However, I've run into a problem that I can't seem to resolve, so I decided to ask y'all, since no problems seems unsolvable on this forum.

    Long story short, I've created a macro which creates a chart from a worksheet of data. The macro creates the chart on its own chartsheet, (temporarily) naming it "2". The worksheet already has name "NAME Data" and I'd like the chartsheet to be named "NAME" (excuse my lack of grammar, I didn't want punctuation to confuse the quotation marks and such). So at the end of my macro code in VBA, I tried to do the following:

    ActiveSheet.Next.Select
    Sheets("2").Name = ActiveSheet.Name.Parse
    ActiveSheet.Previous.Select
    Application.ScreenUpdating = True
    End Sub
    I know that Parse is obviously not correct, but I really couldn't think of the correct method for this operation, and that was the closest to what I could think of. Basically, I just want the created chartsheet's name to be the name of the worksheet it was created from without the " Data" at the end of that worksheet's name. I apologize, but I absolutely cannot upload the excel file, for it has sensitive information; I may be able to copy/paste additional code from VBA if needed. I am extremely willing to describe the situation better, and I welcome all help. Thank you so much in advance!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Worksheet Naming

    Hi 12frederice and welcome to the forum,

    So you have a worksheet named "Name Data" and you create a chart on a new worksheet. You want to name the new chart worksheet "Name"

    How about something like this.
    While on the Data worksheet you do a call like:
    Please Login or Register  to view this content.
    I think the three lines appropriately placed should do the trick.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-28-2011
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Worksheet Naming

    Thank you very much!

+ 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