Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Excel 2007 chart gridline color using vba

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
  #2   Report Post  
Posted to microsoft.public.excel.charting
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


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Excel 2007 chart gridline color using vba

On 16 Dez., 14:24, "Andy Pope" wrote:
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 - 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


Thank you!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add a gridline in an excel chart with a custom value? jbigelow Charts and Charting in Excel 1 October 1st 07 04:18 PM
How do I print selected gridline color in Excel? Diane McCarty Excel Discussion (Misc queries) 6 May 31st 07 06:22 PM
Color of a specific gridline Ccwm27 Charts and Charting in Excel 1 June 20th 06 09:37 PM
Change default gridline color in Excel 2007 Michael Pass Excel Discussion (Misc queries) 2 June 6th 06 02:17 AM
Different gridline color in the same page ladefense New Users to Excel 2 July 2nd 05 06:11 PM


All times are GMT +1. The time now is 12:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"