I have approx 60 sheet tab each with a chart for each branch in the company. Is it possible to name the charts to equal the sheet tab? There is also a cell that contains the branch number in A33 on each sheet. I could use that reference as well.
I have beeen playing around with this macro:
It requires that there is only one chart per sheet and each sheet has a chart.
Please try it on a document copy.
Code:
Sub ChartRename()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
ActiveSheet.ChartObjects.Select
N = ActiveSheet.ChartObjects.Count
ChrtName = ActiveSheet.ChartObjects(N).Name
ActiveSheet.ChartObjects(ChrtName).Name = ws.Name
Next
End Sub
Thanks. There are other sheets in the wb and a few have multiple charts. The majority of the wb has one chart on each sheet. Is it possible to modify the code to exclude sheet9,7 and 21?
I ran the code and it renamed the charts as needed then on the sheet without a chart it crashed..... as expected. I then just fixed a couple of chart names...... ALL IS WELL.....
THANKS ---- problem solved.
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.