View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default Excel 2007 chart gridline color using vba

Hi,

Here are the various ways fo changing the colour.

With ActiveChart
With .Axes(xlValue, xlPrimary)
If .HasMajorGridlines Then
With .MajorGridlines
.Border.ColorIndex = 5 'set color to blue
.Border.Color = RGB(0, 255, 0) ' green
.Format.Line.ForeColor.ObjectThemeColor =
msoThemeColorAccent2
End With
End If
End With
End With

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
wrote in message
...
Hello,
i want to apply a themecolor to a chart gridline using vba. I can
apply normal colors (RGB, index) but not the theme color. Any idea?

thx.
berg