Replace for Chart Formulas?

kbrownk

New Member
Joined
Jun 18, 2011
Messages
27
Does anyone know if there's a way to replace letters or numbers in series formulas within charts? Seems obvious but I've had no luck googling.

If an example is needed:

I have 2 series in a scatter plot:
=SERIES(Sheet1!$A$1,Sheet1!$C$1:$M$1,Sheet1!$C$2:$M$2,1)
=SERIES(Sheet1!$A$3,Sheet1!$C$3:$M$3,Sheet1!$C$4:$M$4,1)

I'd like to replace all "C" with "O" and "M" with "Y".

In reality I have 68 series so you can see why I don't want to do this manually!

Thanks,
kbrownk
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

littleiitin

Active Member
Joined
Apr 12, 2010
Messages
401
1:Change "Master" with your sheet Name
2: Change "Chart 1" with your Chart Name

Code:
Sub changeaddress()
    With ThisWorkbook.Worksheets("Master")
        With .ChartObjects("Chart 1").Chart
            For i = 1 To .SeriesCollection.Count
               .SeriesCollection(i).Formula = Replace(.SeriesCollection(i).Formula, "$C", "$O")
               .SeriesCollection(i).Formula = Replace(.SeriesCollection(i).Formula, "$M", "$Y")

            Next
        End With
    End With
End Sub
 

kbrownk

New Member
Joined
Jun 18, 2011
Messages
27
Perfect, thanks! This will definitely save me time now and in the future.

kbrownk
 

Watch MrExcel Video

Forum statistics

Threads
1,122,511
Messages
5,596,581
Members
414,079
Latest member
Frills

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top