Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Link cell references to chart titles

Posted on 2011-03-25
8
Medium Priority
?
730 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
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 will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

688 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