Solved

Link cell references to chart titles

Posted on 2011-03-25
8
682 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now