AJP Excel Information AJP Excel Information

VBA code to set transparency of data marker in xl2007

Here is code and an example workbook on how to set transparency of data marker in xl2007. You can set the transparency by altering the colour property of both Forecolor and Backcolor without resorting to changing chart type.
Sub SetDataMarkerTransparency()

Dim chtTemp As Chart
Dim serTemp As Series

Set chtTemp = ActiveSheet.ChartObjects(1).Chart
Set serTemp = chtTemp.SeriesCollection(1)

With serTemp.Format.Fill
    .Solid
    .Visible = True
    .BackColor.RGB = RGB(255, 0, 0)
    .ForeColor.RGB = RGB(255, 0, 0)
    .Transparency = 0.5
End With

End Sub

Created 1st May 2010
Last updated 5th August 2014 


Return to main page Chart Section VBA section Fun and games section Forum files Tips section Links section Book section Site information Site Search RSS feed Top of page


Microsoft® and Microsoft® Excel are registered trademarks of the Microsoft Corporation.
andypope.info is not associated with Microsoft. Copyright ©2007-2016 Andy Pope