I have a Excel workbook full of charts and some data tables on different sheets. I am looking to create a summary of all the chart titles in one sheet.
I have tried some VBA coding but alas I can not quite adapt the code to select and copy across the title of the chart instead of the sheet names.
Set objNewWorkbook = Excel.Application.Workbooks.Add
Set objNewWorksheet = objNewWorkbook.Sheets(1)
For i = 1 To ThisWorkbook.Sheets.Count
objNewWorksheet.Cells(i, 1) = i
objNewWorksheet.Cells(i, 2) = ThisWorkbook.Sheets(i).Name
Next i
I expect a nice list of the titles of the charts. An added bonus would to have the sheet names as well.
ThisWorkbook.Sheets(i).ChartObjects(1).Chart.ChartTitle
. If you have more than one chart per worksheet (or if you have 0 charts on a worksheet, or if the chart doesn't have a title, etc.), you'll need to make some modifications to handle those cases. – David Zemens