+ Reply to Thread
Results 1 to 10 of 10

reference to ThisSheet in in Excel chart

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    reference to ThisSheet in in Excel chart

    I have a tab/worksheet with several named ranges

    The named ranges are defined in this format:
    Insert>Name>Define "plot_time"
    =OFFSET('Curve Fitter (TC#116)'!$C$13,0,0,COUNTA('Curve Fitter (TC#116)'!$D:$D)-1)
    Then these names are used to plot the data in a Line Chart:
    Series1>XValues = ='Curve Fitter (TC#116)'!plot_time
    This works fine except I need to copy another version of the entire worksheet. Now the new sheet has a new name of course. So my hard-coded links are broken. I need something like the equivalent VBA ThisWorkbook, which would be dynamically updated to reference ThisSheet containing the current chart.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: reference to ThisSheet in in Excel chart

    If I've understood you could perhaps try defining the names as:

    Name: plot_time
    RefersTo: =OFFSET(!$C$13,0,0,COUNTA(!$D:$D)-1)

    and use use !plot_time as your reference ?

    (I suspect the Chart ref. might not work - you may need a Chart whizz to help on that front I'm afraid... I am not one I'm afraid)

    perhaps check out Jon Peltier's post: http://www.eggheadcafe.com/software/...--problem.aspx
    Last edited by DonkeyOte; 04-21-2010 at 03:40 AM.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: reference to ThisSheet in in Excel chart

    FWIW I'm convinced the above doesn't help you so apologies ... in essence it just means you have one name in the file which is "relative" to the sheet however I can find no way (as yet) of using this name in the Chart Series.

    Hoping Andy Pope and the like might step in and save both you & I...

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

    Re: reference to ThisSheet in in Excel chart

    It's not clear to me whether you want a VBA solution or not.

    Using a workbook level named ranged means the chart will still refer to the original worksheets cells. So you would need to create a completely new named range and update the chart.

    If you use a worksheet level named range you will find this converted to a static array in the newly copied chart, so this approach will not work.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    Re: reference to ThisSheet in in Excel chart

    Donkey, good idea but there is no way to define a named range without the worksheet name reference. Even if you just select cells A1:Z1, Excel fills in the sheet name automatically, so it is hard-coding the reference to the current sheet.

    Andy, I would prefer a non-VBA solution, just using worksheet functions. I want this solution to work when the sheet is copied multiple times.

    Can you explain the scope of named ranges? The difference between workbook- and worksheet-level ranges i not clear to me. Is there one kind that will automatically update the named range to reference the current shet?

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: reference to ThisSheet in in Excel chart

    Quote Originally Posted by twd000 View Post
    Donkey, good idea but there is no way to define a named range without the worksheet name reference. Even if you just select cells A1:Z1, Excel fills in the sheet name automatically, so it is hard-coding the reference to the current sheet.
    Not that it resolves your charting issue but regards the above, did you test the suggestion ?

+ 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