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
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

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
4,933
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,827
Messages
5,574,531
Members
412,601
Latest member
TheBeaniacExpress
Top