?
Solved

Link cell references to chart titles

Posted on 2011-03-25
8
Medium Priority
?
752 Views
Last Modified: 2012-05-11
Dear Experts:

I got several embedded charts (n= 10) on the active worksheet.
They all got a dummy chart title (Sales 2011)
I got a column with 10 countries entered in the respective cells, starting in F1, i.e. Germany (F1), England (F2) ... Greece (F10).

A macro should achieve the following:

Looping thru F1 till F10 and rename the Chart Titles of the embedded charts to Sales 2011 Germany, Sales 2011 England, .... Sales 2011 (Greece).

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
Comment
Question by:AndreasHermle
  • 4
  • 3
8 Comments
 
LVL 50

Expert Comment

by:Dave Brett
ID: 35213971
While you can do this with code it would require the charts to be in "correct" order dwon the sheet for the titles to be labelled appropriately. Are they descending or side by side?

Note that you can quickly link each cell title to a cell reference a via the edit bar without using code

Cheers

Dave
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 400 total points
ID: 35213977
Why do you need a macro to do a job that takes less than 5 minutos to do?!? It takes more time to make the macro and put it on the file then do the job by hand! If it where 100 charts, that would be worthy to do a macro, but 10?!

Just go to each chart and click on the chart title and on the formula bar put like =A1 on the first, =A2 on the second and so on...

jppinto
0
 
LVL 33

Expert Comment

by:jppinto
ID: 35213987
Please take a look at the attached image...
Capturar.JPG
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 50

Expert Comment

by:Dave Brett
ID: 35213999
That point had been already made
>Note that you can quickly link each cell title to a cell reference a via the edit bar without using code
0
 
LVL 50

Accepted Solution

by:
Dave Brett earned 1600 total points
ID: 35214021
If you were set on code rather than the manual edit bar AND your charts were arranged in the correct order you could use VBA like this sample code and file

Cheers

Dave
Sub ChtTit()
    Dim lngRow As Long
    Dim chr As ChartObject
    For Each chr In ActiveSheet.ChartObjects
        chr.Chart.ChartTitle.Text = [f2].Offset(lngRow, 0).Value
        lngRow = lngRow + 1
    Next
End Sub

Open in new window

chtTitle.xlsm
0
 

Author Comment

by:AndreasHermle
ID: 35217014
Dear Dave, jppinto:

thank you very much for your great and professional support:

jppinto: I am fully aware that I could easily change the chart titles the way you describe. But as you also mentioned, if , say hundreds of charts have to be worked on, a macro would be the best solution. And this may be the case sometime in the future.

Thank you very much again for your great support.

Regards, Andreas
0
 
LVL 33

Expert Comment

by:jppinto
ID: 35217173
Thanks for your response. Glad you found a solution..

regards,

jppinto
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 35219891
Thanks for the grade :)

Dave
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question