+ Reply to Thread
Results 1 to 7 of 7

Change Index Number of Chart Objects

Hybrid View

  1. #1
    Registered User
    Join Date
    03-11-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Change Index Number of Chart Objects

    Hi, I was wondering if there is any way I can change the index number of chart objects? I know I can change the index number of sheets through VB editor object properties, but I can't find a way to do the same for charts (chart objects are not displayed in the VBAProject excel objects list). Please advise, thank you.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Change Index Number of Chart Objects

    Do you mean index number or do you mean it's name?

    How do you change a sheets index?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-11-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Change Index Number of Chart Objects

    I'm referring to the chart object's index number, not the chart name. You are able to change the sheet index number through the VB Editor. Under the VBAProject excel objects list, if you select the sheet and click F4, you can edit the (Name) field which will change the sheet index number. However I haven't been able to find a way to do this with charts and I'm not sure if you can even do that.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Change Index Number of Chart Objects

    Change the sheets tab or codename will not changes it's index. Change the order of the sheets will change it's index. 1 possible exception would be if you where using numbers instead of names.

    You can not change the Index value of a chart. You can change it's name.

    Why do you want to change the index of the chart?

  5. #5
    Registered User
    Join Date
    03-11-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Change Index Number of Chart Objects

    I'm building a macro to alter the formatting of different charts across multiple worksheets. For example, I have worksheets 1, 2, and 3, and in each worksheets I have identical charts A, B, and C. I need to make different formatting adjustments to all the A charts across all 3 sheets, all the B charts across all 3 sheets, and so forth. I can't guarantee the names of these charts will stay the same in the future (model will be run by other users). I was wondering if there is any way I can change the index number of the charts without rebuilding them since Excel numbers the charts based on which one was created first on each sheet, that way the macro can use a loop structure to apply the same set of formatting changes to all the same charts in each sheet. Does that make sense?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Change Index Number of Chart Objects

    The index value is based on creation order and can not be changed.

    You either need to give the charts a name that you can then use to reference.
    Or if the layout is the same you could check the location of chartobjects.

+ 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