Hello
I have the following macro to set chart fonts to arial 10.
But If I apply this macro to a chart that already has fonts colored
differently (lets say some are red, some blue, some white) it changes
all fonts to black. I tried to remove ColorIndex hoping i would than
ignore color, but it doesn't help. How to make macro that will not
change the set colors in the chart?
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Don Guillett - 15 Apr 2008 15:15 GMT
Try JUST this (untested)
sub chgfont()
With Selection.Font
.Name = "Arial"
.Size = 10
end with
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> Hello
> I have the following macro to set chart fonts to arial 10.
[quoted text clipped - 17 lines]
> .Background = xlAutomatic
> End With
Klemen25 - 15 Apr 2008 18:57 GMT
No, this doesnt work- it does work in cells, but with chart data
labels it changes them to Arial, 10, black.
Sorry- I didnt mention before that this problem accures with data
labels? But now I tested and it changes also fonts in x or y axis from
colored to black if this macro is used.
Dave - 15 Apr 2008 19:48 GMT
Hi,
I suggest that you read the current ColorIndex first.
Insert this as your 2nd line of code:
A = Selection.Font.ColorIndex
Then change the 3rd to last line, .ColorIndex = A
Regards - Dave.