Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / July 2009

Tip: Looking for answers? Try searching our database.

Change Series Formulas for all charts on worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
usmc-r70 - 03 Jul 2009 19:08 GMT
I have a workbook with a 'template' worksheet that has 4 charts that
reference data contained only in this worksheet .
 
When I copy the 'template' and rename it (say Project1), the 'Series
Values', 'Series Name', and 'Title' reference in the formula bar continue
referencing the 'template' worksheet.

I found the code shown below and it works for chart 'Series Values', 'Series
Name', but NOT the chart 'Title' that I have referenced in the formula bar.
Credit to: http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D

How can I modify the code below to:

 1. Include the 'Title' reference shown in the formula bar.

 2. Instead of typing the new worksheet name into the dialog box, have the
code reference $AC$37 which has the formula: =MID(CELL("filename",B31),
FIND("]",CELL("filename",B31))+1,255).

Sub ChangeSeriesFormulaAllCharts()
   ''' Do all charts in sheet
   Dim oChart As ChartObject
   Dim OldString As String, NewString As String
   Dim mySrs As Series

   OldString = InputBox("Enter the string to be replaced:", "Enter old
string")

   If Len(OldString) > 1 Then
       NewString = InputBox("Enter the string to replace " & """" _
           & OldString & """:", "Enter new string")
       For Each oChart In ActiveSheet.ChartObjects
           For Each mySrs In oChart.Chart.SeriesCollection
               mySrs.Formula = WorksheetFunction.Substitute(mySrs.Formula,
OldString, NewString)
           Next
       Next
   Else
       MsgBox "Nothing to be replaced.", vbInformation, "Nothing Entered"
   End If
End Sub

http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D
Shane Devenshire - 03 Jul 2009 19:22 GMT
Hi,

Choose Edit, Links, and Change Source to your current workbook.  May be able
to dispense with the macro using this technique.

Signature

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

> I have a workbook with a 'template' worksheet that has 4 charts that
> reference data contained only in this worksheet .
[quoted text clipped - 39 lines]
>
> http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D
usmc-r70 - 03 Jul 2009 20:05 GMT
I am using Excel 2007.  All references to 'Edit, Links, and Change Source' is
'grayed out'.

This code works perfectly on another computer using a simplified version
written in Excel 2007.

> Hi,
>
[quoted text clipped - 44 lines]
> >
> > http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D
Shane Devenshire - 04 Jul 2009 00:36 GMT
Hi,

When you click the chart title what is the formula you see on the Formula Bar?

In 2007 the Edit links command is on the Data tab which I suppose you found.

Signature

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

> I am using Excel 2007.  All references to 'Edit, Links, and Change Source' is
> 'grayed out'.
[quoted text clipped - 50 lines]
> > >
> > > http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D
usmc-r70 - 04 Jul 2009 04:31 GMT
In the formula bar: =TEMPLATE!$AC$62  and without data one chart reads
#DIV/0! , with the other reading #N/A .

When I click outside the chart all the Data tab functions are highlighted.  
When I click inside any chart the all Data tab functions, except Show & Hide
Detail, are 'grayed out'.

> Hi,
>
[quoted text clipped - 56 lines]
> > > >
> > > > http://peltiertech.com/Excel/Charts/ChgSrsFmla.html#ixzz0KCalAl7L&D
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.