Matching Font Colour In Graph Legend

Faysamantha

Board Regular
Joined
Oct 15, 2009
Messages
146
Hi

I have created a line graph from a table of data, however the legend has black font but I need it to match with the colours of the columns from my table.

is this possible?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
If you know the colour of the graph column then you can apply that in the legend.

I have just done this on version 2007.

Select the Chart > Legend > Text in Legend and use the Home Tab and change the colour
 
Upvote 0
Hi

Thank you for your respond. I am using the latest version and cant seem to find that.


Sorry, also forgot to mention that there are 65 different titles, the legend has created its own colours which i need to append to the titles in the data source table.
 
Upvote 0
Look to record a macro to select the graph and adjust the font colour's you then will have enough code to change all the Legend fonts.

Sample code is as follows:

Sub Macro1()
'You need to now the legend entry number and colour that you want
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Legend.Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Legend.LegendEntries(6).Font.Color = vbRed 'I have added this to colour red
ActiveChart.Legend.LegendEntries(5).Font.Color = vbGreen 'I have added this to colour green

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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