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
Solved

Link cell references to chart titles

Posted on 2011-03-25
8
708 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 100 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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 400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

791 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