Chart Title

Rossjp

Board Regular
Joined
Nov 14, 2005
Messages
67
Is there a way to have a chart title pick up the info from a cell on the spreadsheet? for example, I want the title to include a date entered into the chart as well as the name of the individual the spreadsheet contains.

Can anyone help me with this, please?

John
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

sweater_vests_rock

Well-known Member
Joined
Oct 8, 2004
Messages
1,657
john.

welcome to the board!

try this code out -- i'm sorry that i don't know of another way to do this. let me know if you have any questions!

ben.
Code:
Sub CreateChartTitle()

    Dim MyChartTitle As String
    Dim MyChartTitleCell As Range

    Set MyChartTitleCell = Range("A1") '<--Change to your range
    MyChartTitle = MyChartTitle.Value

    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = MyChartTitle
    End With

End Sub
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
review the excel help file entry for 'Link a chart title or text box to a worksheet cell'
 

Jon Peltier

MrExcel MVP
Joined
May 14, 2003
Messages
5,249
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Rossjp said:
Is there a way to have a chart title pick up the info from a cell on the spreadsheet? for example, I want the title to include a date entered into the chart as well as the name of the individual the spreadsheet contains.

Suppose the date is in cell D2 and the name in E2. In F2 write a formula that concatenates this information into the label you need. Something like

=E2&CHAR(10)&"("&TEXT(D2,"DD-MMM-YY")&")"

Select the chart title so it has a thick gray border, press the = key, then click onto cell F2. The formula bar will indicate the link:

=Sheet1!$F$2

and the title will update when the contents of D2 and E2 change.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,835
Messages
5,855,910
Members
431,772
Latest member
dannyboi1

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
Top