Results 1 to 4 of 4

Thread: [Resolved]Empty, Null, and Nothing, oh my! Charts in Excel.

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    41

    Resolved [Resolved]Empty, Null, and Nothing, oh my! Charts in Excel.

    So, I need to read data from excel cells into an array, and then use the array to act as X and Y values for charts that the program creates.

    The problem is that some of the cells are blank-- so I want the chart to not count the blank cells, as if I highlighted them in excel. However, even though I skip these blanks and leave the array location "Empty," it also calls that "zero," which pretty much ruins the graph. I can't just skip zero values in the plotting, even if that were possible, because there are some valid zero values.

    Any ideas on how to make VBA think "" instead, or something like that?
    Thanks
    Last edited by Bartender; Jul 25th, 2005 at 11:07 AM.

  2. #2
    Lively Member
    Join Date
    May 2005
    Location
    derby, uk
    Posts
    83

    Re: Empty, Null, and Nothing, oh my! Charts in Excel.

    not sure about making vba do it, but excels charting engine can be set to ignore blank values, with a line graph this avoids a blank causing everything to drop to zero, while a specified zero will still be plotted...

    Options -> Chart -> Plot Empty Cells As = Interpolated.

    it is not possible it seems to set this on a chart by chart basis, only globally, but it does work.

    the alternative is to calculate an interpolated value yourself

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    41

    Re: Empty, Null, and Nothing, oh my! Charts in Excel.

    Thanks, Dale,

    I think I have a workaround, however, I still need help!
    How can I make :
    VB Code:
    1. ActiveChart.SeriesCollection(1).XValues = Sheets("Sheet 1").Range("C1", ActiveCell.Offset(Counter, 0))
    not return an:
    Error "91"
    Object variable or with block variable not set.

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    41

    Re: Empty, Null, and Nothing, oh my! Charts in Excel.

    I worked around the problem by directly selecting the values and skipping the whole array issue, but that created a new problem, which is totally different and gets its own thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width