Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:52:52+00:00 2026-06-15T19:52:52+00:00

I have a some charts that in which the X Values are text and

  • 0

I have a some charts that in which the X Values are text and Y Values are numerical. I want to color each bar Red if the Y value for the bar is less than zero, Green if greater than or equal to zero. Also, if the X value of the bar is “NET CHANGE”, I need the bar to be yellow. I followed the directions in a previous StackOverflow thread here: Changing Bar colors using VBA based on category label.

I’m getting Run-time error 451 Property let procedure not defined and property get procedure did not return an object.

My code is below:

For chartIterator = 1 To ActiveSheet.ChartObjects.count

    For pointIterator = 1 To ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator).Chart.SeriesCollection(1).Points.count
        If ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator).Chart.SeriesCollection(1).Values(pointIterator) >= 0 Then
            ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator).Chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _
                RGB(146, 208, 80)
        Else
            ActiveWorkbook.Sheets("Due To Chart").ChartObjects(chartIterator).Chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _
                RGB(255, 0, 0)
        End If
    Next pointIterator

Next chartIterator

The error comes up at the IF statement. I also tried .Points(pointIterator).Value, which got me a “property or method not defined for this object” error.

Any thoughts on what I’m doing wrong?

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:52:54+00:00Added an answer on June 15, 2026 at 7:52 pm

    You are running into trouble in your use of SeriesCollection(1).Values, which you are treating as an array that you can iterate over. Instead, this is a function that return the values of the points in the SeriesCollection.

    What’s needed is to assign the results of the function to an array variable, then iterate over the array to test whether the values in the array are greater than or less than zero. Then, you can assign the colors to the chart points.

    This code should do the trick:

        Sub color_chart()
    
        Dim chartIterator As Integer, pointIterator As Integer, _
            seriesArray() As Variant
    
        For chartIterator = 1 To ActiveSheet.ChartObjects.Count
            seriesArray =  ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _
                           chart.SeriesCollection(1).Values
    
            For pointIterator = 1 To UBound(seriesArray)             
    
               If seriesArray(pointIterator) >= 0 Then
                   ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _  
                   chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _
                   RGB(146, 208, 80)
               Else
                   ActiveWorkbook.Sheets("Sheet1").ChartObjects(chartIterator). _
                   chart.SeriesCollection(1).Points(pointIterator).Interior.Color = _
                   RGB(255, 0, 0)
               End If
    
            Next pointIterator
    
        Next chartIterator
    
        End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some pages on my public website that display charts generated by ASP.NET
I have some arbitrary pixel data that I want to save as a PNG.
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
I have the following code which does nothing but reading some values from a
I have some data similar to the following chart: http://developer.yahoo.com/yui/examples/charts/charts-seriescustomization_clean.html Only difference is that
I have a UILabel that displays some chars. Like x, y or rpm. How
I have a php script validation that looks for some special chars and deletes
I have built some highcharts charts and I am displaying them one at a
I have created some simple charts (of type FastLine) with MSChart and update them
I have some working Javascript that manipulates the some DOM elements. The problem is,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.