+ Reply to Thread
Results 1 to 2 of 2

Conditional Colors for Charts

  1. #1
    If
    Guest

    Conditional Colors for Charts

    Hello,
    I have on a sheet with several graphs and I would like to execute the
    procedure below automatically.

    In advance thank you for the assistance
    Yves



    Sub ColorColumns()

    Dim vntValues As Variant
    Dim intSeries As Integer
    Dim intPoint As Integer

    With ActiveChart
    For intSeries = 1 To .SeriesCollection.Count
    With .SeriesCollection(intSeries)
    vntValues = .Values
    For intPoint = 1 To .Points.Count
    If vntValues(intPoint) < 60 Then
    ..Points(intPoint).Interior.Color = vbRed
    ElseIf vntValues(intPoint) >= 60 And vntValues(intPoint) < 80 Then
    ..Points(intPoint).Interior.Color = vbYellow
    Else
    ..Points(intPoint).Interior.Color = vbGreen
    End If
    Next
    End With
    Next
    End With

    End Sub




  2. #2
    Jon Peltier
    Guest

    Re: Conditional Colors for Charts

    Please read the response to your post. You have reposted the same question
    three times since receiving a reply.

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______


    "If" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    > I have on a sheet with several graphs and I would like to execute the
    > procedure below automatically.
    >
    > In advance thank you for the assistance
    > Yves
    >
    >
    >
    > Sub ColorColumns()
    >
    > Dim vntValues As Variant
    > Dim intSeries As Integer
    > Dim intPoint As Integer
    >
    > With ActiveChart
    > For intSeries = 1 To .SeriesCollection.Count
    > With .SeriesCollection(intSeries)
    > vntValues = .Values
    > For intPoint = 1 To .Points.Count
    > If vntValues(intPoint) < 60 Then
    > .Points(intPoint).Interior.Color = vbRed
    > ElseIf vntValues(intPoint) >= 60 And vntValues(intPoint) < 80 Then
    > .Points(intPoint).Interior.Color = vbYellow
    > Else
    > .Points(intPoint).Interior.Color = vbGreen
    > End If
    > Next
    > End With
    > Next
    > End With
    >
    > End Sub
    >
    >
    >




+ 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