+ Reply to Thread
Results 1 to 3 of 3

Referencing worksheet CODENAME in a chart object.

  1. #1
    Bing
    Guest

    Referencing worksheet CODENAME in a chart object.

    Hi all,

    I have an excel chart (generated by the Chart Wizard) that references the
    worksheet NAME. For example, when i right click on chart, and select 'Source
    Data' i see the 'Data Range' reference the worksheet NAME as follows:

    ='Main Menu'!$D$13:$D$14,'Main Menu'!$E$13:$E$14

    But the 'Main Menu' worksheet has a CODE NAME of of "Main". I've tried
    numerous permutations but i just cannot get this chart's Data Range to
    reference the worksheet CODE NAME instead.

    Can anyone help?

    Thanks


  2. #2
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    Heck! I think I'm more confused than you are.

    Never a good idea to use reserved words like "Name" to refer to your bits and pieces. They have their jobs to do already.

    I suggest you go back to basics and rebuild your chart (without using Name) and ensure that when you choose a data series it is exactly what you want it to be by selecting it on the worksheet, rather than relying on names at the moment.

    BTW:What kind of chart are you aiming to generate? What is Main Menu?

    Alf

  3. #3
    Dave Peterson
    Guest

    Re: Referencing worksheet CODENAME in a chart object.

    How about:

    ActiveChart.SetSourceData Source:=Main.Range("d13:e14")

    When I recorded a macro, the range was combined into one reference.

    Even this way worked:

    ActiveChart.SetSourceData Source:=Main.Range("A1:A21,C1:C21"), _
    PlotBy:=xlColumns



    Bing wrote:
    >
    > Hi all,
    >
    > I have an excel chart (generated by the Chart Wizard) that references the
    > worksheet NAME. For example, when i right click on chart, and select 'Source
    > Data' i see the 'Data Range' reference the worksheet NAME as follows:
    >
    > ='Main Menu'!$D$13:$D$14,'Main Menu'!$E$13:$E$14
    >
    > But the 'Main Menu' worksheet has a CODE NAME of of "Main". I've tried
    > numerous permutations but i just cannot get this chart's Data Range to
    > reference the worksheet CODE NAME instead.
    >
    > Can anyone help?
    >
    > Thanks


    --

    Dave Peterson

+ 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