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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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