View Single Post
 
Old 05-11-2017, 06:16 PM
aramaglia aramaglia is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jan 2017
Posts: 8
aramaglia is on a distinguished road
Question Chart Fill Patterns Conditional Formatting

Hey all,

I am trying to loop through each point in my chart and change the individual data point (I am using a bar graph) pattern to the diagonal striped pattern if a certain condition is met. Below is my code

Code:
Set c = ActiveChart
Set s = c.SeriesCollection(2)

nPoint = s.Points.count
    For iPoint = 1 To nPoint
        If s.Values(iPoint) >= 28 Then
            s.Points(iPoint).Interior.Color = RGB(255, 0, 0)
        Else
            s.Points(iPoint).Interior.Color = RGB(0, 255, 0)
        End If
        QN# = s.XValues(iPoint)
        For i = 6 To LRQN
            If Left(QnLog.Range("B" & i).Value, 1) = "I" And QnLog.Range("A" & i).Value = QN# And QnLog.Range("C" & i).Value = "Open" Then
                s.Points(iPoint).Format.Fill.Patterned (msoPatternDashedHorizontal) <-- this doesnt do anything :(
            End If
        Next i
    Next iPoint
Everything works until the pattern is being changed; nothing happens. I have tried numerous syntax's with no avail, and I haven't found much help on this subject so far. What is the proper way to change the fill pattern of a just an individual point?

Thank you.
Reply With Quote