+ Reply to Thread
Results 1 to 3 of 3

Chart Data Source Question

Hybrid View

cluelessnomad Chart Data Source Question 11-20-2014, 11:42 AM
xlbiznes Re: Chart Data Source Question 11-20-2014, 12:09 PM
cluelessnomad Re: Chart Data Source Question 11-20-2014, 12:13 PM
  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Chart Data Source Question

    Hi,
    I have some basic code to create charts from a datasheet. The line which references the data source looks like this:

    .Chart.SetSourceData Source:=datawkb.Sheets(sheetnames(i)).Range("$B$2:$C$2,$E$2,$G$2,$I$2,$K$2,$B$95:$C$97,$E$95:$E$97,$G$95:$G$97,$I$95:$I$97,$K$95:$K$97,$B$102:$C$102,16,$G$102,$I$102,$K$102")
    I'm trying to figure out if I can replace some of those cells with previously declared variables or just numbers. So instead of G102, I can use Var1 instead, which might be the sum of a few other cells.

    Thanks for any help.

  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 Data Source Question

    try something like this :

    Dim ch As Chart
    Dim sr As Series
    Dim myData As Variant
    Set ch = ActiveChart
    Set sr = ch.SeriesCollection(1)
    myData = Array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100) 'data
    sr.Values = myData
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Chart Data Source Question

    Thank you for answering.
    I have tried using series instead of what I have now. I'm wondering if it's possible to use cell coordinates and normal numbers in the same line. Could I do that with a series?

+ 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. To get Chart Data Source of powerpoint chart by excel VBA
    By imran0305 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 07:13 AM
  2. Chart not updated until chart sheet opened following source data update
    By untilyesterday in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-24-2013, 12:27 PM
  3. How do you have one source data in a chart flow into a 2nd source of data?
    By Disintegrate in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-06-2009, 09:26 AM
  4. Chart Question :: Page through source data ???
    By mantic in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-02-2006, 01:29 AM
  5. Question about source data for chart
    By Peter in forum Excel General
    Replies: 1
    Last Post: 09-06-2005, 07:05 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