A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Auto insert sheetname into chart title?



 
 
Thread Tools Display Modes
  #1  
Old May 8th 10, 10:26 PM posted to microsoft.public.excel.worksheet.functions
Ian R[_3_]
external usenet poster
 
Posts: 3
Default Auto insert sheetname into chart title?


Hi

I'm using Excel 2003

I have several charts on a worksheet.

At the end of each month I copy the sheet to become the first worksheet
in the workbook, delete the data and rename the sheet for the following
month.

All my charts have a chart title e.g "Total income for April 2010". The
sheetname is April 2010. When I copy this sheet to become "May 2010" I
then have to manually edit all the chart titles on that sheet.

I wondered if there is a way to reference the sheetname in the chart
title so that when I rename the sheet the chart titles automatically
update.

Thanks for your time.

Ian
Ads
  #2  
Old May 9th 10, 12:28 AM posted to microsoft.public.excel.worksheet.functions
Bob Ryan
external usenet poster
 
Posts: 8
Default Auto insert sheetname into chart title?

On 5/8/2010 5:26 PM, Ian R wrote:
>
> Hi
>
> I'm using Excel 2003
>
> I have several charts on a worksheet.
>
> At the end of each month I copy the sheet to become the first worksheet
> in the workbook, delete the data and rename the sheet for the following
> month.
>
> All my charts have a chart title e.g "Total income for April 2010". The
> sheetname is April 2010. When I copy this sheet to become "May 2010" I
> then have to manually edit all the chart titles on that sheet.
>
> I wondered if there is a way to reference the sheetname in the chart
> title so that when I rename the sheet the chart titles automatically
> update.
>
> Thanks for your time.
>
> Ian


I don't think there's a way to reference a sheet name in a chart title,
but you may want to consider using a macro (VBA).

For example, the macro below will put the title "Total Income for April,
2010" in the chart title for Chart 1 and Chart 2 in the sheet named
"April, 2010." Next month, change the sheet name to "May, 2010," use
Edit>Replace to change every occurrence of the word "April" to "May" in
the macro, and run it. If you have charts on more than one sheet, you
can adjust the sheet names as necessary.

Sheets("April, 2010").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartTitle.Text = "Total Income for April, 2010"
Sheets("April, 2010").Select
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.ChartTitle.Text = "Total Income for April, 2010"

Hope this helps.
Bob Ryan
  #3  
Old May 9th 10, 03:19 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 22,912
Default Auto insert sheetname into chart title?

Get the sheetname into a cell in the worksheet using a FORMULA.

e.g. pick G1

In G1 enter this formula exactly as written.

=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255

That returns the sheetname to G1

Then make your chart title a formula ="Total Income for " & G1


Gord Dibben MS Excel MVP


On Sat, 8 May 2010 22:26:43 +0100, Ian R > wrote:

>
>Hi
>
>I'm using Excel 2003
>
>I have several charts on a worksheet.
>
>At the end of each month I copy the sheet to become the first worksheet
>in the workbook, delete the data and rename the sheet for the following
>month.
>
>All my charts have a chart title e.g "Total income for April 2010". The
>sheetname is April 2010. When I copy this sheet to become "May 2010" I
>then have to manually edit all the chart titles on that sheet.
>
>I wondered if there is a way to reference the sheetname in the chart
>title so that when I rename the sheet the chart titles automatically
>update.
>
>Thanks for your time.
>
>Ian


  #4  
Old May 9th 10, 05:23 AM posted to microsoft.public.excel.worksheet.functions
Bob Ryan
external usenet poster
 
Posts: 8
Default Auto insert sheetname into chart title?

Gord - I learned something new, so thank you. However, i couldn't get
what you described to work. I can make the chart title equal to the cell
containing the sheet name, but I wasn't able to add the text as you
described. Any ideas?


On 5/8/2010 10:19 PM, Gord Dibben wrote:
> Get the sheetname into a cell in the worksheet using a FORMULA.
>
> e.g. pick G1
>
> In G1 enter this formula exactly as written.
>
> =MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
>
> That returns the sheetname to G1
>
> Then make your chart title a formula ="Total Income for "& G1
>
>
> Gord Dibben MS Excel MVP
>
>
> On Sat, 8 May 2010 22:26:43 +0100, Ian > wrote:
>
>>
>> Hi
>>
>> I'm using Excel 2003
>>
>> I have several charts on a worksheet.
>>
>> At the end of each month I copy the sheet to become the first worksheet
>> in the workbook, delete the data and rename the sheet for the following
>> month.
>>
>> All my charts have a chart title e.g "Total income for April 2010". The
>> sheetname is April 2010. When I copy this sheet to become "May 2010" I
>> then have to manually edit all the chart titles on that sheet.
>>
>> I wondered if there is a way to reference the sheetname in the chart
>> title so that when I rename the sheet the chart titles automatically
>> update.
>>
>> Thanks for your time.
>>
>> Ian

>


  #5  
Old May 9th 10, 02:05 PM posted to microsoft.public.excel.worksheet.functions
Don Guillett[_2_]
external usenet poster
 
Posts: 1,513
Default Auto insert sheetname into chart title?

Just amend your cell formula to
="Total Income for " &
MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bob Ryan" > wrote in message
...
> Gord - I learned something new, so thank you. However, i couldn't get what
> you described to work. I can make the chart title equal to the cell
> containing the sheet name, but I wasn't able to add the text as you
> described. Any ideas?
>
>
> On 5/8/2010 10:19 PM, Gord Dibben wrote:
>> Get the sheetname into a cell in the worksheet using a FORMULA.
>>
>> e.g. pick G1
>>
>> In G1 enter this formula exactly as written.
>>
>> =MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
>>
>> That returns the sheetname to G1
>>
>> Then make your chart title a formula ="Total Income for "& G1
>>
>> Gord Dibben MS Excel MVP
>>
>>
>> On Sat, 8 May 2010 22:26:43 +0100, Ian > wrote:
>>
>>>
>>> Hi
>>>
>>> I'm using Excel 2003
>>>
>>> I have several charts on a worksheet.
>>>
>>> At the end of each month I copy the sheet to become the first worksheet
>>> in the workbook, delete the data and rename the sheet for the following
>>> month.
>>>
>>> All my charts have a chart title e.g "Total income for April 2010". The
>>> sheetname is April 2010. When I copy this sheet to become "May 2010" I
>>> then have to manually edit all the chart titles on that sheet.
>>>
>>> I wondered if there is a way to reference the sheetname in the chart
>>> title so that when I rename the sheet the chart titles automatically
>>> update.
>>>
>>> Thanks for your time.
>>>
>>> Ian

>>

>


  #6  
Old May 9th 10, 03:53 PM posted to microsoft.public.excel.worksheet.functions
Bob Ryan
external usenet poster
 
Posts: 8
Default Auto insert sheetname into chart title?

Got it, and then realized I can put the text that will never change in
one cell, the sheet name formula in another cell and either use the
concatenate function or "&" to combine the two, which would then feed
the chart title. Thank you.
Bob

On 5/9/2010 9:05 AM, Don Guillett wrote:
> Just amend your cell formula to
> ="Total Income for " &
> MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
>


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert String Between Dates in Chart Title RyanH Excel Worksheet Functions 5 October 28th 08 08:49 PM
Automatically update SheetName in workbook sub if SheetName changes [email protected] Excel Discussion (Misc queries) 3 February 29th 08 04:33 PM
change chart title with auto filter Aja Charts and Charting in Excel 1 July 16th 05 06:34 AM
Pasting Objects into Chart title and Axis title Sam Charts and Charting in Excel 1 June 6th 05 08:50 PM
Insert contents of a cell into a title of a chart greg stenzel Charts and Charting in Excel 2 February 20th 05 11:19 PM


All times are GMT +1. The time now is 02:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.