+ Reply to Thread
Results 1 to 3 of 3

Line Chart points properties

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Line Chart points properties

    Hi,

    I managed to retrieve several "point" properties but couldn't figure out how to retrieve a point's value.

    Here is a piece of my code:

    ActiveChart.SeriesCollection(2).Points(3).Select
    With ActiveChart.SeriesCollection(2).Points(2)
        MsgBox .MarkerBackgroundColorIndex
        MsgBox .MarkerForegroundColorIndex
        MsgBox .MarkerStyle
        MsgBox .MarkerSize
    End With

    BUT when I try: MsgBox .MarkerValue I get 'Runtime error 438' - object doesn't support...

    Is there any workaround ?

    Thanks, Elm
    Last edited by ElmerS; 07-26-2010 at 02:14 PM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Line Chart points properties

    MarkerValue is not a property of the Point Object. The Point Object properties are all about formatting, not about underlying data.

    The value of the data point can be grabbed off the SeriesCollection.

    Try something along these lines:

    With ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1)
        v = .Values
        For i = 1 To .Points.Count
            With .Points(i)
                MsgBox .MarkerBackgroundColorIndex
                MsgBox .MarkerForegroundColorIndex
                MsgBox .MarkerStyle
                MsgBox .MarkerSize
            End With
            MsgBox v(i)
        Next
        End With
    Last edited by teylyn; 07-26-2010 at 05:55 PM.

  3. #3
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Reykjavík, Iceland
    MS-Off Ver
    Any of: 2003 & 2007
    Posts
    412

    Re: Line Chart points properties

    Thank you Teylyn,

    This helped me to format the points according to their value.

    However, I understand that if I want to format their colors according to the font color they depend of - I will need to browse the source cells in the sheet - or is there any short way around for that ?

    Elm

+ 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