How to Change Axes Title Color

Lewisc_97

New Member
Joined
Feb 25, 2019
Messages
4
Hi People of the Internet,

I am struggling to find the correct line of code to change my x axis titles. I can change the color of the values but I can't find the code to change the color

Any help is appreciated



For Each excelChart In ActiveSheet.ChartObjects

excelChart.Chart.ChartTitle.Format.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)

excelChart.Chart.Axes(xlCategory).TickLabels.Font.Color = RGB(0, 0, 0)

excelChart.Chart.Axes(xlValue).TickLabels.Font.Color = RGB(0, 0, 0)

excelChart.Chart.Legend.Font.Color = RGB(0, 0, 0)


excelChart.Copy

mySlide.Shapes.Paste
Next
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,732
Hi
Welcome to the board

Did you try to record a macro?


Try this on an active chart displaying the X axis title:

Code:
    ActiveChart.Axes(xlCategory).AxisTitle.Format.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 176, 240)
 

JustynaMK

Active Member
Joined
Aug 28, 2016
Messages
436
Try this code - this will work for the selected ("active") chart:

Code:
    With ActiveChart.Axes(xlCategory).AxisTitle.Format.TextFrame2.TextRange.Font.Fill
        .ForeColor.RGB = RGB(0, 255, 200)
    End With
Edit: sorry @pgc01, I just noticed your post.
 
Last edited:

Forum statistics

Threads
1,077,676
Messages
5,335,611
Members
399,028
Latest member
greyland

Some videos you may like

This Week's Hot Topics

Top