+ Reply to Thread
Results 1 to 8 of 8

Chart sourcedata updating with VBA

  1. #1
    Registered User
    Join Date
    10-31-2014
    Location
    Finland
    MS-Off Ver
    2010
    Posts
    5

    Chart sourcedata updating with VBA

    Heya,

    I'm new in here and I usually can find everything I need from internet but this time I can't seem to find anything related to my problem..

    My excel nightmare refreshes data from multiple sources and has multiple charts to update. User has an option to request how many datapoints is shown and I got everything else set up working as of now except updating charts to show only the new values.

    Values are copied to a separate sheet "Graph_Data" and each graph contains 3 data sources

    With this it only changes the datasource to this "=Graph_Data!$RSP$1" and its not working as intended
    Please Login or Register  to view this content.
    Thanks in advance!
    Last edited by thampz; 11-03-2014 at 12:43 AM. Reason: Solved

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Chart sourcedata updating with VBA

    hi,

    please post a sample workbook.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    10-31-2014
    Location
    Finland
    MS-Off Ver
    2010
    Posts
    5

    Re: Chart sourcedata updating with VBA

    Quote Originally Posted by xlbiznes View Post
    hi,

    please post a sample workbook.
    Heya,

    I only need to get the ActiveChart.SeriesCollection(x).Values = "=Graph_Data!RSPX" the rspx part to be inserted from a cell data. My cell, in this case "w1" on rsp2_graph sheet contains "$B$5:$B$13" which I want to insert into the bolded area on the code, so it would become "=Graph_Data!$B$5:$B$13", which would in this case work as intended. If I manually replace the string value on the macro to look like
    ActiveChart.SeriesCollection(1).Values = "=Graph_Data!$B$5:$B$13" the chart will update to show right values.

    This is because the "$B$5:$B$13" part is changed every time I update new data in an other sheet. Thats why I cant just have a chart on static B5:B13 values and I don't want to manually update all the charts every time I update new data in..

    If it still doesn't open up I can provide a sample workbook.

    Thanks

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Chart sourcedata updating with VBA

    Hi,

    Can you try something like this :

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-31-2014
    Location
    Finland
    MS-Off Ver
    2010
    Posts
    5

    Re: Chart sourcedata updating with VBA

    Quote Originally Posted by xlbiznes View Post
    Hi,

    Can you try something like this :

    Please Login or Register  to view this content.
    Heya,

    Sorry, this doesn't work for me as I need to input 3 different data into 3 different "data sources", as I got 2 different Y axis and 1 X axis data.

    Please Login or Register  to view this content.
    The chart template I'm using is "Plotted line with markers" or something.

    Thanks

  6. #6
    Spammer
    Join Date
    01-26-2010
    Location
    Worcester MA
    MS-Off Ver
    Excel 2003
    Posts
    184

    Re: Chart sourcedata updating with VBA

    So "RSPi" is the name of a cell containing an address? The name Graph_Data!RSP1 contains something like "$B$5:$B$13"?

    You want something like:

    Please Login or Register  to view this content.
    Last edited by alansidman; 10-31-2014 at 04:27 PM.
    Jon Peltier
    http://PeltierTech.com/

  7. #7
    Registered User
    Join Date
    10-31-2014
    Location
    Finland
    MS-Off Ver
    2010
    Posts
    5

    Re: Chart sourcedata updating with VBA

    Quote Originally Posted by Jon_Peltier View Post
    So "RSPi" is the name of a cell containing an address? The name Graph_Data!RSP1 contains something like "$B$5:$B$13"?

    You want something like:

    Please Login or Register  to view this content.
    Yes, exactly. Thanks for this, I'll let you know how it works on Monday.

  8. #8
    Registered User
    Join Date
    10-31-2014
    Location
    Finland
    MS-Off Ver
    2010
    Posts
    5

    Re: Chart sourcedata updating with VBA

    Please Login or Register  to view this content.
    Working like a charm! Thanks

+ 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. Updating PivotCache SourceData property
    By LifesABeach in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2013, 07:53 PM
  2. Excel 2007 : SourceData for chart
    By lilahh in forum Excel General
    Replies: 10
    Last Post: 08-10-2011, 09:55 PM
  3. 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
  4. Excel/chart/sourcedata - should let me set the left or right axis
    By belohls in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-19-2006, 05:45 PM
  5. Read SourceData from Chart
    By Fernando in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2005, 12:05 AM

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