+ Reply to Thread
Results 1 to 2 of 2

Multiple SourceData range for charts

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Multiple SourceData range for charts

    Hi
    I have this problem where i am not able to set multiple data source in the chart. I am using this code below and it looks fine but not sure why its still not working. Please help. Thanks

    Sub updatecht
    
        col="R"
    
        ThisWorkbook.Worksheets("Data").ChartObjects("Chart 1").Activate
        ActiveChart.SetSourceData Source:=Sheets("Data").Range("A647:A660", col & "647:" & col & "660")
    end sub
    The result should be
    =Data!$R$647:$R$660,Data!$R$647:$R$660

    but with the code the result is
    =Data!$A$647:$R$660

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Multiple SourceData range for charts

    You may not need VB code at all. This looks like something that could be handled with a named dynamic range. Please attach the workbook with representative but non-sensitive data. OR you can look at these two articles.
    http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges
    http://www.utteraccess.com/wiki/Dynamic_Charting
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. [SOLVED] RAnge for Sourcedata from Chart in VBA 2013--runtimeerror 1004
    By IonutC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2016, 04:53 AM
  2. Multiple Pie Charts For Non-Fixed range
    By hecgroups in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-05-2013, 12:32 PM
  3. copying multiple charts from excel to word overwriting previous charts
    By eric45 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 11:11 AM
  4. VBA Plot Multiple Charts Using Loop Through Dynamic Range
    By sanjeevpandey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 07:38 AM
  5. Creating chart by passing sourcedata as variable range
    By lavi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2010, 09:18 AM
  6. Replies: 2
    Last Post: 09-08-2008, 05:05 AM
  7. [SOLVED] Modify Pivot Table SourceData range
    By Mike Fogleman in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-12-2006, 01:02 PM

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