MS Access Chart Label Color

mr moe

Registered User.
Local time
Today, 00:34
Joined
Jul 24, 2003
Messages
332
Hello, is it possible to create a vba code to make the data label color change based on the value. This is for a column graph in ms access form. I can format the data label or the column color based on series value. Thanks alot.
 
Last edited:
Which version of Access? 2019 overhauled the charts.
 
Apply gradient color to Chart Series
For j = 1 To grphChart.SeriesCollection.Count
With grphChart.SeriesCollection(j)
'.Interior.Color = RGB(Int(Rnd(j) * 200), Int(Rnd(j) * 150), Int(Rnd(j) * 175))
.Fill.OneColorGradient msoGradientVertical, 4, 0.231372549019608
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = Int(Rnd(Timer()) * 54) + 2
'.Barshape = xlCylinder
' xlCylinder, xlConeToPoint, xlBox, xlPiramidtoMax
If typ = 1 Then
.Interior.Color = msoGradientVertical
End If
.DataLabels.Font.Size = 10
.DataLabels.Font.Color = 3
If typ = 1 Then
.DataLabels.Orientation = xlUpward
Else
'.DataLabels.Orientation = xlHorizontal
.DataLabels.Orientation = 45 'titlted angle in degrees
End If
End With
Next
 
Thanks, so it's the old chart style. Modern charts were introduced in 2019. I don't have an answer for you but I thought it would help others answer.
 

Users who are viewing this thread

Back
Top Bottom