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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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)
 
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top